I was playing around and wanted to have a command line interface script to see the latest titles from Drupal Planet. I wipped this Python script to read and display the RSS feed. You need to install feedparser (in Ubuntu: $ sudo aptitude install python-feedparser). Here’s the code:
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’])
To run it:
$ python planet.py
You can save it in ~/bin and create an alias with: $ alias planet='python ~/bin/planet.py' and execute it simply from the CLI with: $ planet
Here’s how it looks:

If you use drush and code modules/templates in Drupal you know the symptom: add a new template file, add a hook to your module, pretty much change a few things in your code and you issue a drush cc all ‘just in case’. Drupal has an extensive cache system which is your friend but unfortunately when coding you often have to clear it so that the new changes can be detected. This constant ‘clear all caches’ can really slow you down. On large sites a drush cc all can take as long as 15-20 seconds to complete. If you are not sure your overriding the correct template or hook then it can become a little annoying to waste so much time.



