geofencedsl
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
geofencedsl [2011/01/25 22:01] – created donpdonp | geofencedsl [2011/01/25 22:33] – donpdonp | ||
---|---|---|---|
Line 1: | Line 1: | ||
== GeoFence DSL == | == GeoFence DSL == | ||
- | javascript | + | Allow users to write javascript |
+ | Attach a code blob to a fence, to automatically be run on any event for that fence. | ||
+ | Attach a blob to the user account to run on any fence event. | ||
- | fences[] - access to each of the defined geofences | ||
+ | Variables | ||
< | < | ||
- | + | event = { " | |
- | function init() | + | " |
- | } | + | " |
- | + | } | |
- | function event(detail) | + | fences[] - access to each of the user defined geofences |
- | } | + | fence = { |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], | ||
+ | [100.0, 1.0], [100.0, 0.0] ] | ||
+ | ] | ||
+ | | ||
+ | inside_fences[] - list of fences currently " | ||
</ | </ | ||
| | ||
+ | Send an email on every fence crossing (blob attached to the user) | ||
+ | < | ||
+ | if event.verb == " | ||
+ | email(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | A fence attached blob will provide the fence variable | ||
+ | < | ||
+ | if (event.verb == " | ||
+ | if ((new Date()) - ace.inside_trigger_time > 10.minutes) { | ||
+ | email(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ |
geofencedsl.txt · Last modified: 2024/01/31 04:08 by 127.0.0.1