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.
- 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.
- Grab the script from github
- Put it somewhere in your
- create .pushrc in your home directory and put something like this in it:
[user] username=<boxcar-email-address> password=<boxcar-account-password>
- You’re done!
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
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
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.