Created
April 18, 2011 13:49
-
-
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... ;-)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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