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.
Cool. I made mention on Dave’s blog!
Thanks again Dave!