Download Horizon :: Staff Members :: TheTechGame.com :: XboxMB YouTube


Old 02-02-2012   #1 (permalink)

LiamRawrr's Avatar
UB3R
Join Date: Sep 2010
Location: Nottingham, UK
Posts: 181
Thanks: 63
Default Xml Help

I have the following code in PHP
PHP Code:
<?php
$query 
$_GET['q'];
$URL = ('http://gdata.youtube.com/feeds/api/videos?q='.$query.'&v=2');
$youtube_feed simplexml_load_file($URL);

foreach (
$youtube_feed->entry as $entry) {
        
$yt $entry->children('http://gdata.youtube.com/schemas/2007');
        
$attrs $yt->statistics->attributes();
        
        echo 
"Title: " $entry->title"<br />";
        echo 
"Author: " $entry->author->name "<br />";
        echo 
"Views: " $attrs['viewCount'] . "<br />";
        echo 
'------------------<br />';
}

?>
And was wondering if it is possible to convert it as such to C#. I can do some of it. Just getting the attribute for 'viewCount' is being a little bit tricky. Here's the API it's scraping the data from.
YouTube Videos matching query: query
__________________

Subscribe to my Youtube. Click Here
LiamRawrr is offline
Reply With Quote


Old 02-02-2012   #2 (permalink)
Regular Member
sgt frankieboy's Avatar
Join Date: Nov 2010
Location: Netherlands
Posts: 2,391
Thanks: 1,738
Default Re: Xml Help

Maybe you should read this.
You can use the google-gdata library to make things simpler.

Developer&#39;s Guide: .NET - YouTube APIs and Tools - Google Code
__________________


Minecraft World Editor - [BETA] YTMP
Programming Resources

Quote:
Originally Posted by Rich Cook
Programming today is a race between software engineers striving to build bigger and better
idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far, the Universe is winning.
sgt frankieboy is online now Send a message via ICQ to sgt frankieboy Send a message via AIM to sgt frankieboy Send a message via MSN to sgt frankieboy Send a message via Yahoo to sgt frankieboy Send a message via Skype™ to sgt frankieboy
Reply With Quote
The following user thanked this post: LiamRawrr


Old 02-02-2012   #3 (permalink)

LiamRawrr's Avatar
UB3R
Join Date: Sep 2010
Location: Nottingham, UK
Posts: 181
Thanks: 63
Default Re: Xml Help

Quote:
Originally Posted by sgt frankieboy View Post
Maybe you should read this.
You can use the google-gdata library to make things simpler.

Developer&#39;s Guide: .NET - YouTube APIs and Tools - Google Code
I have used .NET API before. But I'm not sure on how to return more that just the title.
__________________

Subscribe to my Youtube. Click Here
LiamRawrr is offline
Reply With Quote


Old 02-02-2012   #4 (permalink)
Regular Member
sgt frankieboy's Avatar
Join Date: Nov 2010
Location: Netherlands
Posts: 2,391
Thanks: 1,738
Default Re: Xml Help

Quote:
Originally Posted by LiamRawrr View Post
I have used .NET API before. But I'm not sure on how to return more that just the title.
Read.

It shows how to do everything
__________________


Minecraft World Editor - [BETA] YTMP
Programming Resources

Quote:
Originally Posted by Rich Cook
Programming today is a race between software engineers striving to build bigger and better
idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far, the Universe is winning.
sgt frankieboy is online now Send a message via ICQ to sgt frankieboy Send a message via AIM to sgt frankieboy Send a message via MSN to sgt frankieboy Send a message via Yahoo to sgt frankieboy Send a message via Skype™ to sgt frankieboy
Reply With Quote
The following user thanked this post: LiamRawrr

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:24 AM.


 

Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
COPYRIGHT (c) 2010 - 2012 - XboxMB - DESIGN BY:
EDENWEBS.COM