Created
September 20, 2012 06:11
-
-
Save cesarmiquel/3754219 to your computer and use it in GitHub Desktop.
Read Drupal planet RSS feed and show it on screen. Needs python and feedparser ($ sudo aptitude install python-feedparser)
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 | |
def color(this_color, string): | |
return "\033[" + this_color + "m" + string + "\033[0m" | |
print color('34', '-' * 70) | |
print color('1;34', ' ' * 10 + 'D R U P A L / P L A N E T') | |
print color('34', '-' * 70) | |
python_wiki_rss_url = "http://drupal.org/planet/rss.xml/" | |
feed = feedparser.parse( python_wiki_rss_url ) | |
for item in feed['items']: | |
print color('30', ' >> ') + color('1;37', item['title']) + '\n ' + color('32', item['link']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment