Skip to content

Instantly share code, notes, and snippets.

@cesarmiquel
Created September 20, 2012 06:11
Show Gist options
  • Save cesarmiquel/3754219 to your computer and use it in GitHub Desktop.
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)
import feedparser
def color(this_color, string):
return "\033[" + this_color + "m" + string + "\033[0m"
print
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)
print
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