Sending Prowl Notifications from Linux

More than a year ago, I set up my lovely Chumby alarm clock as a web server (go check it out!), which I find useful every now and again for quickly hosting small files.  Unfortunately, even after upgrading it to an 8GB internal SD card, between all the files I dump on it and my poor log rotation schedule on it, it sometimes manages to run out of file system space and gets kind of cranky.

I recently purchased a copy of Prowl, which is a growl notification app for iOS.  Growl is a universal notification system which I'm planning on building into some embedded hardware projects I'm working on, but I figured that while I had already bought the application, I would see how many other nails I can pound in with this hammer.  Turns out, this was a fairly simple application of said hammer to problem.
I wrote a simple shell script and installed it on my Chumby such that every morning at 8:30AM I wake up to a message on my iPod informing me on how my Chumby is doing.  This is done by generating the report via several lines of Bash, storing it in a temporary file, and then passing it along with my Prowl API key to one magic curl command, which you can see at the end of my code:

Shell code:

To get this working, you'll need to copy this shell script onto your Chumby, and then add a line to your Chumby's crontab to schedule it to run at the desired time.  You'll also need to replace my API key with one of your own.

Now, obviously since this is just using cURL to post the notifications, you can run this script in any environment which supports curl, be it almost any Linux environment, OSX, or pretty much anything else.

I found a forum thread on cocoaforge useful while putting this together.

This can also be done using wget instead of curl, if you prefer.  Note that the version of wget on the Chumby doesn't support SSL, so you'll need to drop back to http instead of the suggested https:
$ wget --post-data 'apikey=2541[snip]4d77&application=wget&event=Test message&description=I can use wget' -O -

Popular Posts