BlogCadre users see no ads!  Popular topics: humor, video, links, cool, wtf.  Go create an account!




Planetising: Part 3

Yes!  It's that time - that time when I talk about how to really make your planet orbit.  This is where you learn how to do cool stuff, such as make your planet automatically refresh, to add cool designs to your planet, and to incorporate your planet feed into your homepages.  That would make this:

Noogz' Amazingly Long-winded discussion about using the planet aggregator, and everything that comes with it, Yay: Part 3
Cron:

This is where the true power of the UNIX Shell comes into play.  Log into your terminal server, and from your root directory, open your favourite text editor (such as nano), and type into it the commands that you would use to manually invoke Planet,  The following commands should be fine: (replace files and directories with whatever you've used)

#!/bin/sh
cd planet
./planet.py ./my-planet/config.ini

Now, type "Ctrl+O" to save the file, give it a name such as planet-cron.sh

Now type "Ctrl+X" to exit Nano, and then issue the command chmod a+x planet-cron.sh - this will make the script you just wrote executable, which means it can be run by cron.  Now for the fun part.  If you've never used Vi, then you're going to hate editing your crontab - you may want to ask your host to fix this for you.  Basically, Vi requires extensive use of the keyboard to type, press the Insert key on your keyboard - Now, crontabs take the following basic format:

[Minute] [Hour] [Day] [Month] [Year] [Command] [Arguments]

Any of the "time" values can have any of the following contents:
Numeric: You specify an exact time (e.g. "30" under minutes means "On the 30th minute of the hour")
*: A "*" (star) value means "run for all values", so if you specify a '*' for hours, it will run on every hour.
*/number: A star followed by a / and a number means "Every [number] units" so a "*/30" in the minutes column would mean "every thirty minutes".

Once you understand this, you may specify a cron command to make your script run.  For example:

*/30 * * * * /home/myusername/planet-cron.sh

will run my script every thirty minutes.  Now, to open Vi and edit your crontab, type crontab -e
and you can then issue your command (to type, press insert).  Once you've written your command, press Escape, and then type :write followed by :quit to install your crontab.  Once every half hour, your planet will update.  If it was successful, the Cron Daemon will send you an e-mail to confirm this.  Every single time you update :D.

Summation:

Congratulations! You now have your very own RSS syndicator installed, and refreshing on a regular basis.  Now for a bit of information as to what you could do with your Planet:

  • Make a cool design using CSS stylesheets.  This is easy. Just write a stylesheet, or download one from the net - then apply it to your HTML template.  An example of how to do this is included in the fancy-examples directory that comes with Planet.
  • Server-Side-Include it into your existing home page: Consult your host on this one, I've done this on my front page at noogz.net - the included page is include.html
As usual, send me an e-mail if you need help with this.  My address is chrisjrn@gmail.com - hope you've enjoyed all of this :)


First Page >> Part 1
Previous Page >> Part 2