Lasso Soft Inc. > Home

[SHp_prowl_9]

LinkSHp_prowl_9
AuthorJonathan Guthrie
CategoryCustom Tag
Version9.x
LicensePublic Domain
Posted05 Nov 2010
Updated05 Nov 2010
More by this author...

Description

Wrapper for the Prowl iPhone notification API. Allows you to send messages from Lasso to your iPhone 3G/3GS via Push notifications. Requires the iPhone Prowl app to receive the notifications. (see http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271 ) More info on Prowl: http://prowl.weks.net

NOTE: this is a Lasso 9 port of Lieven Gekiere's SHp_prowl tag for Lasso 8.5 (http://tagswap.net/SHp_prowl)

Sample Usage

local(p = prowl)
#p->apikey = 'XXX'
#p->application = 'Lasso 9'

#p->update('Hello, this is your conscience speaking.')

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

	define prowl => type {
		data 
			public apikey::string 		= string,
			public application::string 	= string


		private apicheck() => {
			return .apikey != ''
		}
	     
		public retrieve(path::string,post::string='') => { 
			fail_if(!.apicheck, -1, 'api key not set.')
	         
	        protect => {
				handle_error => {
					local(response = 'There was a problem communicating with Prowl.')
				}
				local(getparams = array( 
					'apikey='+.apikey, 
					'application='+encode_url(.application), 
					'event='+encode_url(#post) 
				))
				local(response = include_url('https://prowl.weks.net' + #path + '?' + #getparams->join('&')))
			}
			return #response 
	    }
	     
		public update(event::string) => {
	        local(path = '/publicapi/add') 
	        return .retrieve(#path, string_truncate(#event, 1024))  
	   }
	}

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft