Linode Library Home
Linode Library RSS Feed
Home :: Web Applications :: Social Networking :: Planet
Print View View Source

Create an Aggregate Blog using Planet on Debian 5 (Lenny)

Published: by


This document is an older, unmaintained guide. There may be a new guide available for this software.

The Planet Feed Aggregator takes a collection of RSS feeds and generates what its founders call a "River of News" feed that combines posts from all sources into a single coherent stream. Thus, this software is useful for providing a simple and consolidated overview of ongoing output from selected blogs. Written and configured in Python and run regularly using cron, Planet is easy to configure and use.

Before beginning to follow this guide, we assume that you have completed the getting started guide. If you are new to Linux systems administration you may wish to consider the guides in our using Linux series, particularly the administration basics guide. Beyond this, Planet requires a web server to provide access to the resources it creates, but this document does not depend on specific web server software software.


Installing Software

Before we begin the installation of the Planet software, perform the following commands to make sure the system's package repository is up to date and all of the latest packages have been installed:

apt-get update
apt-get upgrade

Install the Planet software by issuing the following command:

apt-get install planet

This will install the Apache HTTP server as a dependency. Congratulations, we can now begin the configuration of Planet.

Configure Planet

Basic Planet Configuration

For the purposes of example, this document assumes that your web server is configured to use /srv/www/ as the public document root for the domain

Copy the default configuration file to the /srv/www/ directory:

cp /etc/planet.conf /srv/www/

Now edit the file, making sure to modify the following values to conform to the needs of your deployment. Consider the following example:

File excerpt:planet.conf



cache_dir = /srv/www/

output_dir = /srv/www/

items_perpage = 40
days_per_page = 0

template_files = /srv/www/ /srv/www/ /srv/www/ /srv/www/ /srv/www/ /srv/www/

items_per_page = 30

These settings establish the name and some background information regarding the site. The output_dir determines where Planet will build the site, and should point to a publicly accessible directory equivalent to or beneath the "document root" of your web server. The items_perpage and days_per_page limit the number of posts displayed on all Planet-generated pages. items_per_page trims the number of posts included in the feed to not surpass the threshold set. days_per_page sets a hard limit for the number of days of oldest possible post that can be displayed.

The remaining settings control the behavior and use of templates. Issue the following commands to copy the default templates and other support files into a site specific configuration:

mkdir -p /srv/www/
mkdir -p /srv/www/
cp /var/lib/planet/templates/* /srv/www/
cp -R /var/lib/planet/www/images/ /srv/www/
cp /usr/share/doc/planet/examples/planet.* /srv/www/

If you want to override any of the default values like the encoding or the value of items_per_page as seen above, simply create an item block beginning with the full path to the template and specify the values beneath. If you need planet to generate an additional template, simply add the full path to the template to the end of the template_files list.

Configuring Aggregation

At the end of your planet.conf file, add entries that resemble the following for each feed that you would like to collect in the Planet you're building

File excerpt:planet.conf

name = Linode Library

If you want to take advantage of Planet's support for per-feed "faces" or avatars to identify each feed with a distinct logo or image, consider the following examples:

File excerpt:planet.conf

facewidth = 64
faceheight = 64

name = Linode Library
face = lin-lib-avatar.png

You can specify default "width" and "height" in the [DEFAULT] stanza, but these values can be overridden for feed-specific settings. All "faces" should be stored in an images/ directory beneath the output directory. In the case of this example, deposit images into /srv/www/

Once you have completed your modifications to planet.conf run Planet for the first time by issuing the following command:

planetplanet /srv/www/

The Planet software will only poll the source feeds when the above command is used. Otherwise, all files generated by Planet are static. By maintaining multiple planet.conf files and specifying distinct output directories, it's possible to generate multiple Planet-based websites on a single server.

Running Planet

While you can run Planet without incident using the above method, we recommend running planet regularly using a "cronjob." Edit your crontab file with the following command:

crontab -e

Insert the following job into the crontab:

File excerpt:crontab

*/10 * * * * planetplanet /srv/www/

Save the crontab. Your Planet generated site will refresh every 10 minutes. Congratulations!

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

Creative Commons License

This guide is licensed under a Creative Commons Attribution-NoDerivs 3.0 United States License.

Last edited by Sharon Campbell on Friday, October 4th, 2013 (r3787).