Forum - Project: GetInfos - Better XML output


Forum: Project: GetInfos   Topic: Better XML output Forums Index

Geekathome 1. Post 2009-12-03 17:49:28
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

This was reporting as a bug by JMTVMS. Please guys: The buglist ist just for bugs. Take a look at this structure and report your mind about the best way for the xml output.

the current output for the XML is to confuse and leads to a big problem when parsing.


You could try something like this:

<?xml version="1.0" encoding="utf-8"?>
<Result>
<ApiInfo>
  <Name>GetInfosByPsnId Script</Name>
  <Sourced>http://api.geekweb.org/psn/getinfos/</Sourced>;;
  <Description>GET Information by PSN-ID</Description>
  <Version>0.3.200</Version>
  <State>unstable</State>
  <LastUpdate>2009-11-21</LastUpdate>
  <Creator>Geekweb API PSN Community: http://psn.gwdev.org/</Creator>;;
  <Codes>http://api.geekweb.org/psn/getinfos/unstable/code.php</Codes>;;
</ApiInfo>
<ForumProfiles>
  <ForumProfile>
    <Location>US</Location>
    <UserId>1765054</UserId>
    <Link>http://boardsus.playstation.com/t5/user/viewprofilepage/user-id/1765054</Link>;;
    <RegDate>10-05-2008 09:34 PM</RegDate>
    <ImageUrl>http://assets.np.us.playstation.com/avatar/WWS_E/E0007.png?w=60</ImageUrl>;;
    <OnlineState>Offline</OnlineState>
    <Ranking>Junior</Ranking>
  </ForumProfile>
</ForumProfiles>
<Widgets>
  <Widget>
    <Location>US</Location>
    <Image>http://pid.us.playstation.com/user/JMTVMS.jpg</Image>;;
  </Widget>
  <Widget>
    <Location>EU</Location>
    <Image>http://mypsn.eu.playstation.com/psn/profile/JMTVMS.png</Image>;;
  </Widget>
  <Widget>
    <Location>mmos</Location>
    <Image>http://mypsn.eu.playstation.com/psn/profile/JMTVMS.png</Image>;;
  </Widget>
  <Widget>
    <Location>playfire</Location>
    <Image>http://pfcdn.net/site/trophy_widget/psn/JMTVMS.png</Image>;;
  </Widget>
</Widgets>
<Trophies>
  <GrandTotals>
    <GrandTotal>
      <Location>EU</Location>
      <Platinum>0</Platinum>
      <Gold>4</Gold>
      <Silver>46</Silver>
      <Bronze>176</Bronze>
      <Total>226</Total>
      <Level>6</Level>
      <Percent>19</Percent>
    </GrandTotal>
    <GrandTotal>
      <Location>US</Location>
      <Platinum>0</Platinum>
      <Gold>4</Gold>
      <Silver>46</Silver>
      <Bronze>176</Bronze>
      <Total>226</Total>
      <Level>6</Level>
      <Percent>19</Percent>
    </GrandTotal>
  </GrandTotals>
  <GameTotals>
    <GameTotal>
      <Game>
        <GameId>11069</GameId>
        <Name>Uncharted 2: Among Thieves</Name>
        <OriginalName>11069-Uncharted-2-Among-Thieves</OriginalName>
      </Game>
      <Trophy>
        <Percent>20</Percent>
        <Platinum>0</Platinum>
        <Gold>0</Gold>
        <Silver>1</Silver>
        <Bronze>12</Bronze>
      </Trophy>
    </GameTotal>
    <GameTotal>
      <Game>
        <GameId>10998</GameId>
        <Name>inFamous</Name>
        <OriginalName>10998-inFamous</OriginalName>
      </Game>
      <Trophy>
        <Percent>52</Percent>
        <Platinum>0</Platinum>
        <Gold>0</Gold>
        <Silver>6</Silver>
        <Bronze>22</Bronze>
      </Trophy>
    </GameTotal>
  </GameTotals>
</Trophies>
<Countries>
  <Country>
    <Location>EU</Location>
    <Hash>4e7e81b4ceb9cd6c34a92f20dbfcfb75</Hash>
    <CC>UK</CC>
    <Name>United Kingdom</Name>
  </Country>
</Countries>
</Result>

This kind of output is more readable
You can contact me at joao [at] miguel [dot] ms

HTH

--
Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps

Projects
$_COM
$_ORG
GetAuthData
GetId
GetInfos
psnapi.org at ...
Folding@Home: 193066
IRC (freenode): #psnapi
PS Home (Club): api
Others
API Statistics (live)
Newest members (3)
HomeOnline
OzyMaximus
thp44
Online now
0 Members
Support us