I had a need, in one of the projects I have been hacking on recently, for a way for an automated process to send messages to a twitter feed based on certain system events – log file changes, inotify updates, etc.

The various existing projects seemed to do much more than I needed and were not easily apt-getable, so I hacked a quick one together in PHP.

A simple toy, no mistake, but combined with a number of other simple tools turns out to be quite handy for automation, given how twitter (currently) glues many disparate services together and acts as an informal protocol between them.

So, being a good FOSS citizen, here you go. Perhaps it’ll save someone a couple of minutes!

» Visit the project on Github…

Inotify is a Linux subsystem which monitors the filesystem for changes, and provides a way to trigger actions when it does.

This is handy, since it means that your program/demon can avoid polling for changes constantly, making it more efficient and reliable. As an aside, this is how the Linux Dropbox tool works.

I was reminded of its existence by a recent hacker news article, so I decided to have a little play over lunch. Here is a little toy I hacked together which monitors a directory for text files containing URLs. When it detects a new one the script retrieves it via WGET and deposited in a nominated downloads directory.

This is a trivial use of the technology, although it is still quite useful, letting me trigger large downloads via my phone or ipad which then get automatically fetched by my NAS without the need to fire up my desktop machine.

» Visit the project on Github…

Image by Oxygen Team, used under the GPL2 licence.