[ Content | View menu ]

Netflix RSS

Written on December 30, 2004

Did you know that Netflix has RSS feeds?

Here’s a bit of Python code I whipped up for a friend to fetch one of their feeds and print out the titles. All you need is this script and Mark Pilgrim’s ultra-liberal feed parser and away you go.

import feedparser
url = 'http://rss.netflix.com/Top25RSS?gid=296'

def main():
  feed = feedparser.parse(url)
  for item in feed['items']:
    print item['title']

if __name__ == ‘__main__’:
  main()

Of course, thanks to Python’s list comprehensions it could have been reduced to two lines, if you’re into that sort of thing:

import feedparser
print [item['title'] for item in feedparser.parse(’http://rss.netflix.com/Top25RSS?gid=296′)['items']]

Python — making programming FUN again! :)

Filed in: Programming.

2 Comments

Write comment - TrackBack - RSS Comments

  1. Comment by Paul:

    Cool. I made mention on Dave’s blog!

    Thanks again Dave!

    January 2, 2005 @ 2:48 am
  2. Comment by Dave:
    Glad I could help. :)
    January 2, 2005 @ 11:21 am
Write comment

Comment spam protected by SpamBam