Display a YouTube user's uploaded videos - XML

Hey guys, i’m trying to put together a script that will display a YouTube user’s uploaded videos. I have the script working, but what I need it to do now is generate an xml based off what the php spits out.

The php script below shows the uploaded videos.

PHP code:
http://pastebin.com/HWBNyyTz

Here is the XML structure

<playlist title=" "> <item title="" id=""/> </playlist>

So…. i’m trying to get the YouTube ID of the videos inside the “id” attribute value and of course get the YouTube title inside the “title” attribute value.

and also, of course the more video’s the user have uploaded the more the xml would be, For example- if they have 10 videos uploaded it would show like this:

<playlist title=" "> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> <item title="" id=""/> </playlist>

Any help would be greatly appreciated, Thanks.
Timothy

Sponsor our Newsletter | Privacy Policy | Terms of Service