geofencedsl
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| geofencedsl [2011/01/25 22:01] – created donpdonp | geofencedsl [2024/01/31 04:08] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| 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(" | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Send an email if I'm at the ACE for 10 minutes (blob attached to the fence) | ||
| + | < | ||
| + | if (event.verb == " | ||
| + | if ((new Date()) - fence.inside_trigger_time > 10.minutes) { | ||
| + | email(" | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
geofencedsl.1295992871.txt.gz · Last modified: 2024/01/31 04:08 (external edit)