Whereiskitty.quixotic.eu - how it's done

Introduction

I like travel, and as part of my job and lifestyle I travel alot. Many friends were getting confused as to where I was at any given time, and failing to keep up with my constant peregrination, so I set up Where is kitty? as a simple place to find out where I am. The page is designed for simple and easy scraping. Hence its simplistic nature.

After I had the site up a couple of people asked for an rss feed as well, so a few minutes of hacking together a shell script, and now we have rss functionality.

Since the site has been live, I have been asked a few times to how I do manage Whereiskitty. I have therefore taken the time to tidy up the shell scripts abit, and put them here for anyone else who wants to use them. I have stuck a gpl license on them. If you adapt the code in anyway, please let me know.

The Code

The code is split into two parts, WhereIsKitty.sh creates the main index page, rss.sh creates the RSS. By default WhereIsKitty.sh calls rss.sh to generate the rss so it is all on one single command, but the two parts can be called seperately, or if you don't want rss, you can comment out the line in WhereIsKitty.sh, and ignore rss.sh.

As you can see the scripts are really simple, the gpl dislaimer takes up most of the script. To use WhereIsKitty.sh simply edit the two files to reflect your local settings, you will need to change the path where the files are created. This done, you simply invoke the script on the command line, passing it your location as a command line argument:

 user@hostname:~$ ./WhereIsKitty "Vladivostok" 

That's all there is to it. Being a simple shell script you can do timed updates using either at or cron. I use the rss feed from WhereIsKitty to feed into a twitter account so people can follow my travels via twitter as well. I use rss2twitter.com to feed the rss into twitter.

If you do use this script on your site, please drop me a mail letting me know. Feel free to follow my travels on twitter. Enjoy!

Derivative works

The code behind WhereIsKitty has been used as the basis of the shell scripts used for generating the rss on http://quixotic.eu/ site.


This page last modified Friday, 28-Aug-2009 21:08:48 CEST.