Skip to main content

Ralsina.Me — Roberto Alsina's website

Planeta PyAr, or how to generate multiple planets with rawdog

I just fin­ished im­ple­ment­ing my first pub­lic plan­et, Plan­e­ta PyAr us­ing raw­dog. It con­tains the blogs of mem­bers of Python Ar­genti­na

To avoid the clas­si­cal ar­gu­ment about whether this is "the plan­et of peo­ple in PyAr" or "pos­ta about python from peo­ple in PyAr", I de­cid­ed to hack raw­dog in­to pro­duc­ing both.

I did­n't want to have two sep­a­rate raw­dog con­fig­u­ra­tions, so I start­ed look­ing at plug­ins.

The ba­sis was the se­lect­feeds plug­in and the rss plug­in.

Then I merged se­lect­feeds in­to rss to make things sim­pler.

Here is my hacked ver­sion which takes the se­lect­feed ar­gu­ment and us­es on­ly those feeds when cre­at­ing the HTM­L, FOAF, OPML and RSS files.

The bad side of this is that se­lect­feed re­quires you post the feed URLs all in one line!

With just a cou­ple dozen blogs in the plan­et, that means sev­er­al hun­dred char­ac­ter­s. And then when you de­cide to change one URL... ick.

So, I wrote a tiny script to take sep­a­rate feed files and cre­ate sep­a­rate con­fig files, merge-­con­fig.py.

Now, I cre­ate a feed­s-­full file with the non-python-spe­cif­ic feeds in raw­dog for­mat:

#############
# 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 feed­s-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 com­mon con­fig­u­ra­tions in con­fig-base.

And merge-­con­fig.py pro­duces a con­fig, a con­fig-­full and a con­fig-python.

Then run raw­dog 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 plan­ets for the cost of one and a half.I won­der why oth­er plan­ets don't pro­vide this.

jjconti / 2009-02-22 12:21:

El autor de Radog hace una música muy copada!

Roberto Alsina / 2009-02-22 12:23:

No sabía, voy a chusmear :-)


Contents © 2000-2023 Roberto Alsina