--- author: '' category: '' date: 2009/02/21 20:19 description: '' link: '' priority: '' slug: BB776 tags: programming, python title: Planeta PyAr, or how to generate multiple planets with rawdog type: text updated: 2009/02/21 20:19 url_type: '' --- I just finished implementing my first public planet, `Planeta PyAr`_ using rawdog_. It contains the blogs of members of `Python Argentina`_ .. _python argentina: http://python.com.ar To avoid the classical argument about whether this is "the planet of people in PyAr" or "posta about python from people in PyAr", I decided to hack rawdog into producing both. I didn't want to have two separate rawdog configurations, so I started looking at plugins. The basis was the selectfeeds_ plugin and the rss_ plugin. Then I merged selectfeeds into rss to make things simpler. Here is my `hacked version`_ which takes the selectfeed argument and uses only those feeds when creating the HTML, FOAF, OPML and RSS files. The bad side of this is that selectfeed requires you post the feed URLs all in one line! With just a couple dozen blogs in the planet, that means several hundred characters. And then when you decide to change one URL... ick. So, I wrote a tiny script to take separate feed files and create separate config files, merge-config.py_. .. _merge-config.py: http://pastebin.ca/1343954 Now, I create a feeds-full file with the non-python-specific feeds in rawdog format:: ############# # Feeds full ############# # Anthony Lenton feed 20m http://anthony.lenton.com.ar/feed/es/ # Rivendel feed 20m http://www.ceportela.com.ar/?feed=rss2 # Facundo Batista feed 20m http://feeds2.feedburner.com/com/wEER : : And the same for a feeds-python:: ################### # Feeds solo python ################### # Anthony Lenton feed 20m http://anthony.lenton.com.ar/?feed=rss2&cat=4&language=es # Rivendel # No tiene RSS solo python # Facundo Batista # No tiene RSS solo python # Gabriel PatiƱo feed 20m http://gepatino.blogspot.com/feeds/posts/default/-/Python : : : Put all the common configurations in config-base. And merge-config.py produces a config, a config-full and a config-python. Then run rawdog like this:: cd ~/.rawdog ; LANG=es_ES rawdog -c config-full -w ; LANG=es_ES rawdog -c config-python -w And that's it, two planets for the cost of one and a half.I wonder why other planets don't provide this. .. _hacked version: http://pastebin.ca/1343952 .. _selectfeeds: http://offog.org/darcs/rawdog-plugins/select-feeds.py .. _rss: https://launchpad.net/rawdog-rss .. _planeta pyar: http://pyar.netmanagers.com.ar .. _rawdog: http://offog.org/code/rawdog.html