Posted .

What is it?

push.py is a quick and (reasonably) dirty python script I knocked together to send boxcar push notifications to my iPhone. It keeps login details in a config file in your home directory so they don’t have to be in the world-readable script, and allows sending the same notification to multiple boxcar accounts in one command. Note that it doesn’t send push notifications that other people can subscribe to; it just sends them to known accounts, for which you have the boxcar login details.

Getting it

  1. Make sure you have boxcar active on your phone, and the growl service enabled on your account (growl is currently the only service which allows api access.) You don’t actually need to have growl installed on your machine; it doesn’t even need to be a Mac. You just need to have the boxcar growl service active, because this script looks like the growl plugin to boxcar’s servers.
  2. Grab the script from github
  3. Put it somewhere in your $PATH
  4. create .pushrc in your home directory and put something like this in it:
  5. You’re done!

Using it

Sending yourself a notification is as simple as:

 % push.py this is a message

By default, the sender name will be the hostname of the machine you’re running on, although that can be overridden on the command line (with the -s option.)

If you want to support more than one boxcar account, just add more sections to the config file, and then specify them on the command line with the -u option. For example, your .pushrc file might look like this:



In which case, you could send notifications to both accounts with:

 % push.py -u user -u support Hi guys

Just bear in mind that if you don’t specify a user using -u then ‘user’ is the default, so it’s a good idea to make sure you always have that one in your config.

If it’s more convenient, you can specify the message to push on stdin, rather than the command line, using the `-r` option:

 % echo hello | push.py -r

Other Options

This is far from the only way you can interact with boxcar’s service. If you’re a Mac user, there’s a growl plugin that will forward growl alerts. If you’re a roll-your-own type, then the API is dead simple to use, and boxcar themselves just released a Ruby gem. Head over to their site for details on both of those.

One Response to “Push.py”

  1. Remko

    can you edit this for python 2.7? (xbmc)

    i have 1% programming skillz :) and althought i did write some little thing once. editing this goes beyond my knowlage.

    Very much appriciated <3

Leave a Reply

You must be logged in to post a comment.