I originally wrote this code as part of my Growl Pepper plugin for Shaun Innman's Mint stats tracking software. Anytime someone visited a page on my website the server would send a Growl notification to my computer. It's not very practical, but it is fun to see visitors on your site in real-time.
Using the code is pretty simple:
$growl = new Growl($some_ip_address, 'growl password'); // Register with the remote machine. // You only need to do this once. $growl->register(); // Send your message $growl->notify("My Alert", "New Website Visitor", "Here's the body text");
If all goes well (and you have UDP port 9887 open in your firewall settings) your Growl notification should go through.
View the Growl Network Protocol Format.