[SHp_prowl_9]

Description

Link: [SHp_prowl_9]
Author: Jonathan Guthrie
Category: Custom Tag
Version: 9.x
License: Public Domain
Posted: Nov. 05, 2010
Updated: Nov. 05, 2010
More by this author...

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)

Parameters

none


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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net