Skip to content

Instantly share code, notes, and snippets.

@ntoll
Created April 18, 2011 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntoll/925373 to your computer and use it in GitHub Desktop.
Save ntoll/925373 to your computer and use it in GitHub Desktop.
A slight modification for Jareth - automatically gets the RSS feed. See inline comments... ;-)
import feedparser
import httplib2 # This library allows you to make HTTP requests
# Defines the URL of the RSS feed for BoingBoing.net
RSS_FEED = "http://feeds.boingboing.net/boingboing/iBag"
# Create a new Http object and use it to make a request to get the feed
http = httplib2.Http()
# headers contains the result headers, boingboing_rss contains the feed itself
headers, boingboing_rss = http.request(RSS_FEED)
# Your original code follows:
print boingboing_rss
feed = feedparser.parse(boingboing_rss)
print feed
print feed["items"]
print feed["channel"]["description"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment