<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Dev411 Blog: Category planet</title>
  <subtitle type="html">John Wang on Technology</subtitle>
  <id>tag:www.dev411.com,2005:Typo</id>
  <generator uri="http://www.typosphere.org" version="4.0">Typo</generator>
  <link href="http://www.dev411.com/blog/xml/atom/category/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.dev411.com/blog/tag/planet" rel="alternate" type="text/html"/>
  <updated>2007-06-16T12:30:23-05:00</updated>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:70982ba135c6edfa48d63a7036a553e5</id>
    <published>2006-07-30T23:16:00-05:00</published>
    <updated>2007-06-16T12:30:23-05:00</updated>
    <title type="html">Planet Engines: Plagger and Planet</title>
    <link href="http://www.dev411.com/blog/2006/07/30/planet-engines-plagger-and-planet" rel="alternate" type="text/html"/>
    <category term="planet" scheme="http://www.dev411.com/blog/tag/planet" label="planet"/>
    <category term="plagger" scheme="http://www.dev411.com/blog/tag/plagger" label="plagger"/>
    <category term="dreamhost" scheme="http://www.dev411.com/blog/tag/dreamhost" label="dreamhost"/>
    <summary type="html">&lt;p&gt;Planet engines are applications that aggregate RSS/Atom feeds and generate composite feeds as well as a website. The generated feeds typically include RSS, Atom, FOAF and OPML. Two popular open source planet engines are &lt;a href="http://www.planetplanet.org/"&gt;Planet&lt;/a&gt; and &lt;a href="http://plagger.org/"&gt;Plagger&lt;/a&gt;. I've used both to create planet-style websites and here are my observations:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Planet engines are applications that aggregate RSS/Atom feeds and generate composite feeds as well as a website. The generated feeds typically include RSS, Atom, FOAF and OPML. Two popular open source planet engines are &lt;a href="http://www.planetplanet.org/"&gt;Planet&lt;/a&gt; and &lt;a href="http://plagger.org/"&gt;Plagger&lt;/a&gt;. I've used both to create planet-style websites and here are my observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Planet:&lt;/strong&gt; This is a Python-based planet engine originally created for &lt;a href="http://planet.gnome.org/"&gt;Planet Gnome&lt;/a&gt; and &lt;a href="http://planet.debian.net/"&gt;Planet Debian&lt;/a&gt;. It is super easy to to install as there's not even really an install to speak of, you just untar it into place. The issue with Planet is that it has limited functionality and uses a monolithic architecture that makes adding features difficult. For example, the code to generate the HTML and XML files is in a 953-line file called &lt;span class="fix"&gt;__init__.py&lt;/span&gt;. I hacked a feature on to Planet a while back and had to modify some methods and add a new one to &lt;span class="fix"&gt;__init__.py&lt;/span&gt;. It worked but didn't seem clean or very maintainable so I'm reluctant to add even more features at this point. Here are my notes on &lt;a href="http://www.dev411.com/wiki/Installing_Planet"&gt;Installing Planet&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plagger:&lt;/strong&gt; This is a Perl-based planet engine written by &lt;a href="http://bulknews.typepad.com/"&gt;Tatsuhiko Miyagawa&lt;/a&gt; who currently works for SixApart, the makers of MovableType, LiveJournal, TypePad and Vox. Although Plagger is a planet engine it does a lot more and is really a pluggable RSS/Atom feed aggregation framework/platform that supports building planet-style websites via one of its many plugins. Its plugin architecture supports the following types of plugins: Aggregator, Bundle, CustomFeed, Filter, Notify, Publish, Search, SmartFeed, Subscription and Widget. Planet sites are generated by &lt;span class="fix"&gt;Plagger::Plugin::Bundle::Planet&lt;/span&gt;. Plagger will also send aggregated feeds to your email account using &lt;span class="fix"&gt;Plagger::Plugin::Publish::Gmail&lt;/span&gt;. This is similiar to what &lt;a href="http://newspipe.sourceforge.org"&gt;Newspipe&lt;/a&gt; (Python-based) does but Newspipe only does RSS to email. Configuring Plagger is simple once you've installed it, but installation can be tricky since it has many CPAN dependencies. However, it's not too difficult and I've done it on a dedicated CentOS server as well as on a shared hosting account at Dreamhost using these &lt;a href="http://www.dev411.com/wiki/Installing_Plagger"&gt;Installing Plagger instructions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are interested in running a planet-style feed aggregation site, I highly recommend Plagger since it's just as easy to configure but has many more capabilities and a better architecture for extensibility. Installation takes a bit longer but give it a shot, it's worth it.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:c833628f9d4aab957f04be622ff90199</id>
    <published>2006-06-13T21:52:00-05:00</published>
    <updated>2007-06-16T12:30:22-05:00</updated>
    <title type="html">Python - First Impressions from Hacking PlanetPlanet</title>
    <link href="http://www.dev411.com/blog/2006/06/13/python-first-impressions-hacking-planetplanet" rel="alternate" type="text/html"/>
    <category term="python" scheme="http://www.dev411.com/blog/tag/python" label="python"/>
    <category term="planet" scheme="http://www.dev411.com/blog/tag/planet" label="planet"/>
    <category term="hacks" scheme="http://www.dev411.com/blog/tag/hacks" label="hacks"/>
    <summary type="html">&lt;p&gt;Over the weekend I got to use Python for the first time to add channel categories to &lt;a href="http://www.planetplanet.org/"&gt;Planet&lt;/a&gt; which can be seen in action at &lt;a href="http://www.planetmvc.org"&gt;Planet MVC&lt;/a&gt;. My first impressions of Python is that the resulting code looks very clean. The syntax was also easy to pick up primarily due to the excellent docs site and because it reminded me of JavaScript.&lt;/p&gt;

&lt;p&gt;The first problem I ran into was using the regex object's &lt;span class="fix"&gt;re.match&lt;/span&gt; which definately does not follow the Python philosophy of "&lt;a href="http://www.python.org/dev/culture.html"&gt;There should be one -- and preferably only one -- obvious way to do it&lt;/a&gt;" because there's more than one way and &lt;span class="fix"&gt;re.match&lt;/span&gt; is not obvious because it works different than other languages. Python's &lt;span class="fix"&gt;re.match&lt;/span&gt; automatically starts from the begining of the string unlike regex engines for other languages (grep|sed|awk|perl|ruby). This results in the following behavior:&lt;/p&gt;

&lt;pre&gt;# matches - pattern is at start of string
m = re.match('b', 'bc')

# does not match - pattern is not at start of string
m = re.match('b', 'abc')

# matches - add the .* to match any leading characters
# but .* isn't needed after '.*b' to match 'c'
m = re.match('.*b', 'abc')

# matches - second .* matches 'c' but isn't needed
m = re.match('.*b.*', 'abc')&lt;/pre&gt;

&lt;p&gt;I was sticking to &lt;span class="fix"&gt;re.match&lt;/span&gt; because I needed the &lt;span class="fix"&gt;MatchObject&lt;/span&gt; to capture groups but it didn't DWIW. After posting to a forum, I learned that I should use &lt;span class="fix"&gt;re.search&lt;/span&gt; instead which will match anywhere in the string. &lt;span class="fix"&gt;re.search&lt;/span&gt; also returns a &lt;span class="fix"&gt;MatchObject&lt;/span&gt; but I didn't expect this at first because search != match. I get the impression &lt;span class="fix"&gt;re.match&lt;/span&gt; and &lt;span class="fix"&gt;MatchObject&lt;/span&gt; were created first and &lt;span class="fix"&gt;re.search&lt;/span&gt; was added later. Perhaps the &lt;span class="fix"&gt;MatchObject&lt;/span&gt; should be called something generic, like &lt;span class="fix"&gt;ResultObject&lt;/span&gt;, in the docs. I'm sort of curious but when is &lt;span class="fix"&gt;re.match&lt;/span&gt; desired over &lt;span class="fix"&gt;re.search&lt;/span&gt;? It seems like &lt;span class="fix"&gt;re.match&lt;/span&gt; is useful only in a limited number of situations and then it's always easy to implement it with &lt;span class="fix"&gt;re.search&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;The open issue for me is Python's dependency on indenting. Lately I've been using tabs exclusively for indentation because I like to see the tickmarks may editors show for tabs. This lets me quickly know what level I'm at. This &lt;a href="http://mail.python.org/pipermail/python-list/2004-July/228199.html"&gt;python-list thread&lt;/a&gt; was titled Tab Wars and argued in favor of spaces over tabs. Planet is indented with spaces and that's what I used for my hacking. Given my preference for tabs, the more time I spend with Python the more likely I'll switch to tabs. Do I need to convert the entire script to tabs or can I mix tabs with spaces? What do people with a preference for tabs do with Python code that uses spaces?&lt;/p&gt;

&lt;p&gt;I've been thinking about releasing my enhanced version of PlanetPlanet which allows one planet site to run multiple planets but now I'm thinking I want to do more enhancements to make it even more user friendly. Let me know how &lt;a href="http://www.planetmvc.org"&gt;Planet MVC&lt;/a&gt; is working for you or if I can add any additional blogs. I've already found it pretty useful to find out about things I otherwise wouldn't have.&lt;/p&gt;

&lt;p&gt;Here are &lt;a href="http://www.dev411.com/wiki/PlanetPlanet"&gt;some notes on getting Planet running&lt;/a&gt;.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Over the weekend I got to use Python for the first time to add channel categories to &lt;a href="http://www.planetplanet.org/"&gt;Planet&lt;/a&gt; which can be seen in action at &lt;a href="http://www.planetmvc.org"&gt;Planet MVC&lt;/a&gt;. My first impressions of Python is that the resulting code looks very clean. The syntax was also easy to pick up primarily due to the excellent docs site and because it reminded me of JavaScript.&lt;/p&gt;

&lt;p&gt;The first problem I ran into was using the regex object's &lt;span class="fix"&gt;re.match&lt;/span&gt; which definately does not follow the Python philosophy of "&lt;a href="http://www.python.org/dev/culture.html"&gt;There should be one -- and preferably only one -- obvious way to do it&lt;/a&gt;" because there's more than one way and &lt;span class="fix"&gt;re.match&lt;/span&gt; is not obvious because it works different than other languages. Python's &lt;span class="fix"&gt;re.match&lt;/span&gt; automatically starts from the begining of the string unlike regex engines for other languages (grep|sed|awk|perl|ruby). This results in the following behavior:&lt;/p&gt;

&lt;pre&gt;# matches - pattern is at start of string
m = re.match('b', 'bc')

# does not match - pattern is not at start of string
m = re.match('b', 'abc')

# matches - add the .* to match any leading characters
# but .* isn't needed after '.*b' to match 'c'
m = re.match('.*b', 'abc')

# matches - second .* matches 'c' but isn't needed
m = re.match('.*b.*', 'abc')&lt;/pre&gt;

&lt;p&gt;I was sticking to &lt;span class="fix"&gt;re.match&lt;/span&gt; because I needed the &lt;span class="fix"&gt;MatchObject&lt;/span&gt; to capture groups but it didn't DWIW. After posting to a forum, I learned that I should use &lt;span class="fix"&gt;re.search&lt;/span&gt; instead which will match anywhere in the string. &lt;span class="fix"&gt;re.search&lt;/span&gt; also returns a &lt;span class="fix"&gt;MatchObject&lt;/span&gt; but I didn't expect this at first because search != match. I get the impression &lt;span class="fix"&gt;re.match&lt;/span&gt; and &lt;span class="fix"&gt;MatchObject&lt;/span&gt; were created first and &lt;span class="fix"&gt;re.search&lt;/span&gt; was added later. Perhaps the &lt;span class="fix"&gt;MatchObject&lt;/span&gt; should be called something generic, like &lt;span class="fix"&gt;ResultObject&lt;/span&gt;, in the docs. I'm sort of curious but when is &lt;span class="fix"&gt;re.match&lt;/span&gt; desired over &lt;span class="fix"&gt;re.search&lt;/span&gt;? It seems like &lt;span class="fix"&gt;re.match&lt;/span&gt; is useful only in a limited number of situations and then it's always easy to implement it with &lt;span class="fix"&gt;re.search&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;The open issue for me is Python's dependency on indenting. Lately I've been using tabs exclusively for indentation because I like to see the tickmarks may editors show for tabs. This lets me quickly know what level I'm at. This &lt;a href="http://mail.python.org/pipermail/python-list/2004-July/228199.html"&gt;python-list thread&lt;/a&gt; was titled Tab Wars and argued in favor of spaces over tabs. Planet is indented with spaces and that's what I used for my hacking. Given my preference for tabs, the more time I spend with Python the more likely I'll switch to tabs. Do I need to convert the entire script to tabs or can I mix tabs with spaces? What do people with a preference for tabs do with Python code that uses spaces?&lt;/p&gt;

&lt;p&gt;I've been thinking about releasing my enhanced version of PlanetPlanet which allows one planet site to run multiple planets but now I'm thinking I want to do more enhancements to make it even more user friendly. Let me know how &lt;a href="http://www.planetmvc.org"&gt;Planet MVC&lt;/a&gt; is working for you or if I can add any additional blogs. I've already found it pretty useful to find out about things I otherwise wouldn't have.&lt;/p&gt;

&lt;p&gt;Here are &lt;a href="http://www.dev411.com/wiki/PlanetPlanet"&gt;some notes on getting Planet running&lt;/a&gt;.&lt;/p&gt;

</content>
  </entry>
</feed>

