Bio

Christopher Flynn

Webdeveloper, husband, dad, surfer, ameteur photographer, tinkerer, 2nd amendment advocate, brewer, chef, libertarian, atheist, UNIX Geek, troublemaker.


Using Prowl for the iPhone

One thing that was missing from the iPhone was push notifications. Then apple released the 3.0 firmware, the only problem was, it required applications to push things and there was no easy way for you to push something yourself. Fortunately the developer Zachary West developed the application Prowl. (Available from the iTunes store) This application caught my attention because of it's integration with growl which is a system notifier for OS X. Growl is nice because it is integrated with a lot of applications and let's you know when file transfers are done, when handbrake is finished encoding a video, etc...

Now I can start to rip a DVD to put on my iPhone and walk away. I'll get notified when it's done by Prowl. In order for this to work you will need to install the growl plugin but it's easy to do. Once I started using this, I looked at the other options of Prowl.

The first thing you'll need is to get an account on prowl's website. Once you've registered, you can get your API key on the settings page. This key identifies your phone so you can send messages to it. There are a number of libraries and plugins that you can use, we're going to look at the python library prowlpy.

You'll need the httplib2 library installed and then download and install prowlpy. You should have 3 files, README, example.py and prowl.py. The important one is prowl.py however we'll want to look at example.py to see how to use it. The example is pretty straight forward, first you set the apikey variable which you'll want to change to your key. Then it creates a prowlpy instance and tries setting the message, if it fails it prints the error to the console. To run it, do: "python example.py" and it should send your message. To customize it, you can change the application, event and description fields. It can also be written by naming each parameter like so: p.add(application='Shell Task',event='done', description='Shell task is finished')

If you add "#!/usr/bin/python" without the quotes as the first line and make the file executable, you can run the file from the command line. If you put this file in your home directory (along with the prowlpy.py file) you can then run it using the command "~/done.py" if you named the file done.py. This can be useful to alert you that a task is done. On my linux server I use gentoo which uses emerge to install programs. I can then type: "emerge whatever; ~/done.py" and when it's done emerging it will alert me on my phone. This is useful because sometimes it can take a while so it's nice to be able to walk away and get a push notification on my phone when it's done.

Next I'll show you how to use prowl and google voice to avoid SMS charges on your iPhone.

Comments

show comment form

 
Christopher Flynn