20, July 2008

parsing youtube uRSS - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: parsing youtube uRSS
« previous next »
Pages: [1] Print

Author Topic: parsing youtube uRSS  (Read 1219 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« on: Apr 17, 2007, 11:02:51 PM »

Hi,

my youtube is messed up, time to write a real youtube parser Smiley

I the RSS resource site from you tube is really good for listings and each item holds all information you need on your website.

I thought about to parse for every new request the RSS feed (don't accept big performance problems in the beginning)

but what if the user click a link to see a detail with the video?

what is the best way to pass that information to the next page? or is better to store the data in a database?


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Apr 17, 2007, 11:04:34 PM »

I hope I 'm looking on the right source page:

http://www.youtube.com/rssls Visit through proxy


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Apr 17, 2007, 11:05:48 PM »

I think I got the answer...

http://www.youtube.com/dev_docs Visit through proxy


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Apr 17, 2007, 11:10:10 PM »

I think I got the answer...

http://www.youtube.com/dev_docs Visit through proxy

but inside the result is no .swf link Sad


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #4 on: Apr 18, 2007, 09:19:19 PM »

Ok, let's start over. What is your problem now? Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Apr 18, 2007, 09:29:25 PM »

Ok, let's start over. What is your problem now? Smiley
hehe, I start a website using their RSS feeds and will see if this information is enough for my needs...


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #6 on: Apr 18, 2007, 09:42:29 PM »

Ok, here is the solution :

$embed ereg_replace("',)",'',array_pop(explode('?v='$item['guid'])));

echo 
'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$embed.'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$embed.'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';


I would explain it more, but I know you understand how to use it Wink


Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Apr 18, 2007, 09:47:58 PM »

sure but I can access the XML via dom or after parsing with magpie as an array, using the rss there is no html code Smiley


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #8 on: Apr 18, 2007, 09:50:40 PM »

This example is for use with magpie (or any other RSS reader you like)

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Apr 18, 2007, 09:53:42 PM »

This example is for use with magpie (or any other RSS reader you like)

you don't need it check the node you got from the RSS: (I think you're using the api)

Code:
<item>
<author>rss@youtube.com (guitar90)</author>
<title>guitar</title>
<link>http://youtube.com/?v=QjA5faZF1A8</link>
<description>
<![CDATA[
<img src="http://sjl-static4.sjl.youtube.com/vi/QjA5faZF1A8/2.jpg" align="right" border="0" width="120" height="90" vspace="4" hspace="4" />
<p>
this guy iz great!!!
</p>
<p>
Author: <a href="http://youtube.com/profile?user=guitar90">guitar90</a><br/>
Keywords:  <a href="/results?search_query=guitar">guitar</a><br/>
Added: December 20, 2005<br/>
</p>
]]>
</description>
<guid isPermaLink="true">http://youtube.com/?v=QjA5faZF1A8</guid>
<pubDate>Tue, 20 Dec 2005 05:08:43 -0800</pubDate>

<media:player url="http://youtube.com/?v=QjA5faZF1A8" />
<media:thumbnail url="http://sjl-static4.sjl.youtube.com/vi/QjA5faZF1A8/2.jpg" width="120" height="90" />
<media:title>guitar</media:title>
<media:category label="Tags">guitar</media:category>
<media:credit>guitar90</media:credit>
<enclosure url="http://youtube.com/v/QjA5faZF1A8.swf" duration="320" type="application/x-shockwave-flash"/>
</item>


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Apr 19, 2007, 01:30:13 AM »

... ity looks like that several nodes are not recognized by MagPie the last "enclosure" is not included in the parsed array Sad

so I need to write my own parser?


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #11 on: Apr 19, 2007, 01:03:10 PM »

In that case I guess you'll have to create your own....

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: Apr 19, 2007, 01:06:35 PM »

In that case I guess you'll have to create your own....

nope Smiley

I found this one:
http://waxjelly.wordpress.com/2007/03/08/youtube-api-class-redeaux/ Visit through proxy

great now I can modify/improve the first time a class in PHP5 (the link above supports only the tag request)


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #13 on: Apr 19, 2007, 01:12:16 PM »

Good Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6401
Tags : youtube rss parser database Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: parsing youtube uRSS
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 20, 2008, 06:13:16 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.668
Total Topics: 7.373
Total Members: 3.693
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: talelmouaada

19 Guests, 4 Users online :

5 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.