Notifo kicks ass.
Saw Notifo on Hackernews and fell in love. It solves all my irritating headaches when making web apps (mainly that I need access to notifications and can’t do it without a simple free app installed).
I made a quick PHP class for using with Notifo. Give it a whirl if you want to.
Notifo PHP Class (Version 1.01, thanks to Ethan and Michael!)
Be sure to include it; then try this:
$a = new Notifo();try {$a->subscribe_user(‘username’);$a->send_notification(‘username’, ‘message’, ‘title’, ‘URL’);}catch(Exception $e){echo “You had an error; {$e->getMessage()}”;}
Be sure to catch exceptions, there are bound to be quite a few when you get up and running.
Add at line 50:
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
It did not work for me without that line
Ethan
March 20, 2010
There is an error in line 83.
curl::post($url, array($this->username, $this->app_id), array(‘username’=>$username));
should be:
curl::post($this->subscribe_url, array($this->username, $this->app_id), array(‘username’=>$username));
Thanks for the great class!
MichMich
March 22, 2010
Thanks for pointing out the errors guys; I’ve fixed them both and the new link is in the post.
Jawaad
March 22, 2010