Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I used to use the RSS feed to obtain videos from a user. I then used the "description" part of the feed, which contained a nicely HTML-formatted summary of a video. It shows a thumbnail with a link, time of video, username, star rating, etc.

Example:

http://gdata.youtube.com/feeds/base/users/KeepWatchingTheSkies/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile (Search for second tag)

Now I'm trying to use the YouTube API (through the gdata Python interface,) and I'm able to retrieve the video entries, but I can't figure out how to get this "description" that I used to get through the RSS feeds.

How can I do this?

share|improve this question
    
I found a workaround, I'm not interested in an answer for this question anymore, thanks. –  Ram Rachum Nov 25 '10 at 14:16
7  
It would have been nice to have you post your work around instead of running off rudely –  Eight Days of Malaise Feb 26 '11 at 2:52

1 Answer 1

import gdata.youtube
import gdata.alt.appengine
import gdata.youtube.service

class Index(webapp.RequestHandler):
    def get(self):
        client = gdata.youtube.service.YouTubeService()
        feed = client.GetRecentlyFeaturedVideoFeed()
        gdata.alt.appengine.run_on_appengine(client)

        self.response.out.write('<html><body>')
        for entry in feed.entry:
            self.response.out.write('<div>%s</div>' %entry.media.description)
        self.response.out.write('</html></body>')

If you are using a rendering template like Django, instead of self response call the rendering function of the template and pass the variable feed, in your html file call Django variables like this:

replace the self.response with:

templates.render(self, 'home.html',
                    feed=feed,
                 )

and add to your html:

{% for entry in feed.entry %}
    <div>{{entry.media.description}}</div>
{% endfor %}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.