Forum - Project: GetInfos - XML Format


Forum: Project: GetInfos   Topic: XML Format Forums Index

Gimpneek 1. Post 2009-08-06 15:15:54
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

Is there any way of having the API put out the values as nodes with nodevalues?

so instead of:



it outputs:


US
1957683
http://boardsus.playstation.com/t5/user/viewprofilepage/user-id/1957683
02-20-2009 07:47 AM
http://assets.np.us.playstation.com/avatar/WWS_A/A0030.png?w=60
Offline
Junior


It would then make it easier to read back the values in programs such as Flash.

--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Geekathome 2. Post 2009-08-06 15:16:47
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

@Gimpneek: HTML tags (and so XML tags too) will removed by forum posts.
Create a file with the XML string and input the link into the post.

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

Gimpneek 3. Post 2009-08-06 15:19:54
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

Oops,

I've uploaded the original example to http://www.gimpneek.com/downloads/psnapi/original.xml

My edit is at http://www.gimpneek.com/downloads/psnapi/edit.xml


--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Geekathome 4. Post 2009-08-06 15:36:45
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

OK. I just wondering why you want to get this output? The otherone has the same information and can be read by XSL and other transformations easily. Is there a good reason to change the XML output into your proposition?

Btw:
1. Your new XML isn't well formed. Remove the " before the 'img' tag closing.
2. You can use the page 'files' (from this community site) to upload any files.

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

Gimpneek 5. Post 2009-08-06 16:33:10
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

Sorry about the Edit, it was a quick edit to show roughly what I was talking about. The reason I want the output is because when using XML in Flash it's easier to use the node value than the attributes.

I'm lazy :P



--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Geekathome 6. Post 2009-08-06 16:39:34
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

Change the structure is a problem, becouse all the people (sites) that are using the output, must change their translations. And more than one XML output by the same out.php doesn't make sence, in my mind. But you can create an XSL that converts the GetInfos XML output into your XML structure. Is this an acceptable solution for you?

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

Gimpneek 7. Post 2009-08-14 21:55:11
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

I've never used an XSL but if there's a way that's kool

--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Geekathome 8. Post 2009-08-16 00:32:45
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

Here is an XSL that converts the XML output into a node only XML:
http://api.geekweb.org/psn/community/?page=files&item=15&load=file

Copy this and save it to your server.
Convert it by PHP or anything like that.

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

Geekathome 9. Post 2009-08-20 05:05:02
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

Becouse of an easier XML string calculation your wishes nearly comes true ;).
Take a look at the new output (just unstable yet):
http://api.geekweb.org/psn/community/?page=forum&forum=4&topic=19

So you don't need the xmlnode.xsl anymore (if you get the data by unstable).

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

Gimpneek 10. Post 2009-08-22 14:16:14
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

Sorry for the delay, just checked it out and it's what I wanted :)



--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Gimpneek 11. Post 2009-08-23 18:21:16
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

I'm having a slight issue with reading the xml file using PHP, there's no DTD so the file fails validation.

--
http://www.gimpneek.com/downloads/psnapi (API experiments)

Geekathome 12. Post 2009-08-23 18:46:17
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104

Right. It will be included in the next unstable:
http://api.geekweb.org/psn/community/?page=todos&item=6

If you are using PHP 5 >= 5.2.0, use the json output. It's a better way than converting XML.
How to use json by php: http://www.php.net/json/

Here an example:
<?
$psnid
= "Gimpneek";
$cat = "trophy|widget";
$url = "http://api.geekweb.org/psn/getinfos/unstable/out.php";
$url .= "?psnid=".$psnid."&cat=".$cat."&out=json";
$code = file_get_contents($url);
$obj = json_decode($code);
// ...
?>

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

Gimpneek 13. Post 2009-08-23 20:38:15
User-ID: 9
Colin Wren
Function: Author
Group: Default
Posts: 9

I've had a little experience with JSON.

I agree it's easier to get the data out, I've just had a little test with it and it's much much simpler, thanks.

I'll be converting my current project to JSON now.

--
http://www.gimpneek.com/downloads/psnapi (API experiments)

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