Is there any way of displaying the thumbnails from a YouTube-RSS-feed in the sidebar?
Thanks in advance,
YouTube thumbnails
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: YouTube thumbnails
Hi!
Have you tried using the Remote OPML/RSS sidebar plugin?
How does a youtube RSS feed look like? I'm sure it can be done.
Regards,
Garvin
Have you tried using the Remote OPML/RSS sidebar plugin?
How does a youtube RSS feed look like? I'm sure it can be done.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: YouTube thumbnails
Yes, I have tried to modify the RSS-plugin but no luck.
Here's an example of an item in such a feed:
I want to display the media:thumbnail element (the thumbnail image) and link it to the video.
See for example http://www.youtube.com/rss/user/youtube/videos.rssgarvinhicking wrote:How does a youtube RSS feed look like? I'm sure it can be done.
Here's an example of an item in such a feed:
Code: Select all
<item>
<author>rss@youtube.com (YouTube)</author>
<title>Bill Clinton talks about the YouTube Nonprofit Program</title>
<link>http://youtube.com/?v=fvfumQ0_0_Q</link>
<description>
<![CDATA[
<img src="http://img.youtube.com/vi/fvfumQ0_0_Q/default.jpg" align="right" border="0" width="120" height="90" vspace="4" hspace="4" />
<p>
With Chad, Steve and Larry, President Clinton talks about the YouTube Nonprofit Program.
http://youtube.com/nonprofits
Thanks to YouTuber theresident for shooting this footage!
http://youtube.com/theresident
</p>
<p>
Author: <a href="http://youtube.com/profile?user=YouTube">YouTube</a><br/>
Keywords: <a href="/results?search_query=youtube">youtube</a> <a href="/results?search_query=nonprofit">nonprofit</a> <a href="/results?search_query=program">program</a><br/>
Added: September 28, 2007<br/>
</p>
]]>
</description>
<guid isPermaLink="true">http://youtube.com/?v=fvfumQ0_0_Q</guid>
<pubDate>Fri, 28 Sep 2007 16:08:36 -0700</pubDate>
<media:player url="http://youtube.com/?v=fvfumQ0_0_Q" />
<media:thumbnail url="http://img.youtube.com/vi/fvfumQ0_0_Q/default.jpg" width="120" height="90" />
<media:title>Bill Clinton talks about the YouTube Nonprofit Program</media:title>
<media:category label="Tags">youtube nonprofit program</media:category>
<media:credit>YouTube</media:credit>
<enclosure url="http://youtube.com/v/fvfumQ0_0_Q.swf" duration="179" type="application/x-shockwave-flash"/>
</item>
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: YouTube thumbnails
Hi!
Uh, this is actually complex, because you would need customized code to do so.
You could simply display the "description" element with the full content?
To modify the plugin, you need to edit the serendipity_plugin_remoterss.php plugin file and chagne the "generate_content" method. There you'll need to insert PHP code to do the necessary HTML transformation of the media:thumbnail element.
The important part is this part of the code:
that would need to be modified. HOWEVER the problem is that the youtube RSS puts the media:thumbnail stuff into an attribute ("url=...") instead in the content of a <media:thumbnail>...</media:thumbnail> attribute. That sucks, because the Onyx RSS library cannot parse attributes. So you would need to fully switch the used RSS decoder to magpie or something else, which is more work than I could spend right now.
Maybe you could use the Yahoo Pipes! application to transform a youtube feed to a proper feed which will contain a:
element, because then you could use an unmodified version of the plugin and simply configured "media:thumbnail" as the required output element.
Regards,
Garvin
Uh, this is actually complex, because you would need customized code to do so.
You could simply display the "description" element with the full content?
To modify the plugin, you need to edit the serendipity_plugin_remoterss.php plugin file and chagne the "generate_content" method. There you'll need to insert PHP code to do the necessary HTML transformation of the media:thumbnail element.
The important part is this part of the code:
Code: Select all
foreach($rss_elements AS $rss_element) {
$rss_element = trim($rss_element);
if ($escape_rss) {
$content .= $this->decode($item[$rss_element]);
} else {
$content .= htmlspecialchars($this->decode($item[$rss_element]));
}
}
Maybe you could use the Yahoo Pipes! application to transform a youtube feed to a proper feed which will contain a:
Code: Select all
<media:thumbnail><![CDATA[<img src="/blabla.jpg" />]]></media:thumbnail>
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi,
I managed to modify the feed using www.referd.info, however this site seems to be pretty unstable...
More importantly, I had to modify the RSS-plugin to display the image URL. It shows up in the feed as <thumbnail_url>http://someurl.com/img.jpg</thumbnail_url>, and the unmodified version will display this URL as plain text. Any way to change this and use the unmodified version?
Thanks in advance,
I managed to modify the feed using www.referd.info, however this site seems to be pretty unstable...
More importantly, I had to modify the RSS-plugin to display the image URL. It shows up in the feed as <thumbnail_url>http://someurl.com/img.jpg</thumbnail_url>, and the unmodified version will display this URL as plain text. Any way to change this and use the unmodified version?
Thanks in advance,
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Did you look at Yahoo Pipes?
Regards,
Garvin
Sadly not,because of the same reasons: You would need conditional logic to insert text. You would either need to edit the PHP plugin file for that (and add the extra 'img' parameter) or use an external RSS-modification service.Any way to change this and use the unmodified version?
Did you look at Yahoo Pipes?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: YouTube thumbnails
Hi,
I have the same problem as described in this thread. Is there a new solution to it?
I have the same problem as described in this thread. Is there a new solution to it?
my S9Y-Blogs: my personal brainbackup | [url=http://www.viennacityflats,at]Vienna Apartments Rental[/url] | Kasperls Geschichten | various other Sites using S9y as CMS