This is a game changer.
Forget almost everything I’ve said about using Mac::Growl for sending notifications to your iPhone via Prowl. Masayoshi Sekimura has written WebService::Prowl based on the recently-available Prowl API and it makes everything stupidly easy. The Growl-Test script I wrote in the previous post was 117 lines of code (including comments). The following script achieves the same effect in only eleven (11) lines of code with no comments. Notice the following advantages:
- Because we communicate directly with the Prowl web service, we don’t need a Mac system with Growl installed;
- We only need to install the WebService::Prowl module;
- Somewhat non-obviously, application registration is no longer necessary;
- You no longer need to mess with changing any Growl settings at all. None;
In order to use WebService::Prowl, you’ll need to sign in to your Prowl account, then click Settings. On that page, you’ll see a section entitled API Key containing a button labeled Generate API Key. Click that button, then copy and paste the resulting key over YOUR API KEY HERE in the script below. Then run the script and you’ll receive your notification on your iPhone.
Here’s the script, which I basically copied from Sekimura’s WebService::Prowl page.
use strict; use WebService::Prowl;
my $apiKey = ‘YOUR API KEY HERE’; my $ws = WebService::Prowl->new(apikey => $apiKey); $ws->verify || die $ws->error(); $ws->add(application => “WebService Test”, event => “testie”, description => “Look Ma! No Growl!”, );
Edit: I’ve installed the WebService::Prowl service on a Linux box, copied the script over with no changes, run it, and received the notification on my iPhone. So you can disregard my Net::Growl post as well.
Edit 2: Because WebService::Prowl operates independently of Growl, we can now send notifications from any platform that runs Perl, which encompasses all major and many minor operating systems. Zachary West is going to make a lot of money off Prowl. The API was pure genius and Sekimura’s simple implementation was genius +1. This is good stuff.