Twitter Bot

For fun, I decided to create a bot that randomly tweets bird noises such as ‘cheep’ ‘tweet’ ‘quack’ etc. I can imagine it would get annoying incredibly quickly so I have thought about making it tweet very infrequently (once a week-ish maybe?). There is some generation with the bird call i.e. sometimes one or two calls and a large list of calls to choose from (although getting something other than ‘Tweet’ should be uncommon).

It was suggested that I make the bot tweet at sunrise/sunset which I thought was a cool idea and I may pursue it. I have looked for existing library’s to calculate these times on a day by day basis but all the (Java) librarys I found were not even close to accurate. It looks like its easiest to implement my own sunrise/sunset library; for the moment and I have an algorithm to implement and I could make use of some existing code I just need to convert.

If you want to follow my bot, it would love to have some friends and you can do so here. The Twitter Bots wiki page is here.

The Galaxy Game

While at uni and coming to terms with the exciting world of programming I made the galaxy game. Feel free to play it here.

Galaxy Game
Galaxy Game

The rules of the game are rather unique and confusing, but it is somewhat similar to Minesweeper and has an amount of luck involved with it. Late last year I decided (it was suggested to me) to make a solver for this game and  I had a few iterations of working solvers, going from fairly naive to what I felt was pretty good. I have decided to start over again with a nicer version of the game and a boast worthy solver. Stay tuned or watch the wiki page for progress.

Apache Log Notifications in Linux

A NotifyOSD notification of log activity
A NotifyOSD notification of log activity

I have a small personal website, as you can see, that gets the odd visitor now and then. This makes me happy! so I like to know about it. There are plenty of statistic gathering scripts like Google Analytics that generate excellent aggregate data, but for my scale of website I prefer a more fine-grain monitoring. I use BBClone for this and it does an awesome job. Other than wishing it had the option for a SQL back-end, I always thought it would be great to have a real time notification of someone paying a visit.

Thus my java ApacheLogNotifier was born!

Using Java and Ubuntus port of NotifyOSD via the notification demon, I have created a small program to poll the tail of my Apache log and notify me whenever there is interesting activity. At the moment I ignoring localhost and bots, so that I can see if an actual person has just come to visit my website. There is a lot of work and refactoring to be done. My initial prototype is just a rushed couple of hours work (thanks to reusing the tail code from http://www.informit.com/guides/content.aspx?g=java&seqNum=226).

For more information and to get the code look at the wiki page.