Critter’s Code

This is a picture of a bridge and a city. I like bridges and cities. They make me smile.

Archive for the ‘CF9’ Category

Aug-13-2009

Ctz-Prowl updated

I made a couple of updates to the files. I added the attributes for proxyservers and proxyport. I also separated out the two examples so they are easier to use.

I’ve updated the zip file on ctzProwl.RiaForge.


VN:F [1.7.5_995]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.5_995]
Rating: 0 (from 0 votes)
Posted under CF9, ColdFusion, CtzProwl, Projects
Aug-11-2009

Push notifications on your iPhone via ColdFusion

There’s an app you can purchase in Itunes App Store that will allow you to send push notifications to your Iphone. The iphone application is called “Prowl: Growl Client” You can download a plugin that integrates with Growl on the MAC (and I believe windows too) allowing you to receive copies of growl notices from your computer to your phone.

While this is all fine and dandy. Prowl also exposes an API, which allows for 1,000 notifications sent per hour per IP. The API allows for easy integration and access via ColdFusion. The possibilities of what this could be used for are endless.

I’ve created a CFC that will allow you to easily send notifications to your iphone via the Prowl servers. Actually… I’ve created two CFCs. One for ColdFusion v9.0 using (scripting FTW!1!) and a version of the CFC that uses tags.

Set your account variables and create your object:

1
2
3
4
apikey = "ei4irkfkddkdkdkdke3ie9r9r9";
providerkey = "";
callto = "<a class="linkification-ext" title="Linkification: https://prowl.weks.net/publicapi/" href="https://prowl.weks.net/publicapi/">https://prowl.weks.net/publicapi/</a>";
appname = "Critter's Code'";

// connect to the prowl cfc //
p = createObject(”component”,”ctzprowl”).init(_apikey=apikey, _callto=callto, _providerkey=providerkey, _appname=appname);

and our calls to the service:

1
2
// verify account (it does count against your 1,0000 requests per hour)
x = p.verify();

if(x.complete and x.code eq 200)
{
// send notification to devices registered to our account. //
y = p.add(priority=’0′,event=’CF9′,description=”I’m in your phone via CF9′”);
}
// dump x (our verification call)
writedump(var=x,label=’Verification results’);

if(isDefined(”y”))
{
writeoutput(’
‘);
writedump(var=y,label=’Add Notification results’);
}

Below is a screen of the dumps:

and the notification on my phone:

Basically.. for $2.99 you can program your server to send you notifications based on whatever..

I just need to finish packing a few things up with it.. and I’ll throw it up on RiaForge.

UPDATE:

I’ve uploaded the code to http://ctzprowl.riaforge.org

Itunes Link
Prowl Website (signup and generate API key)


VN:F [1.7.5_995]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.5_995]
Rating: 0 (from 0 votes)
Posted under CF9, ColdFusion, CtzProwl, Iphone, Projects