geofencedsl
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| geofencedsl [2011/01/25 22:14] – 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. | ||
| Variables | Variables | ||
| < | < | ||
| - | event = { fence : <The specific fence that caused the event> | + | event = { "fence" |
| - | date : <trigger date> | + | "date" |
| - | verb : IN | OUT | + | "verb" |
| } | } | ||
| fences[] - access to each of the user defined geofences | fences[] - access to each of the user defined geofences | ||
| - | fence = { name : "Fence Name" | + | fence = { |
| - | | + | " |
| - | | + | " |
| - | } | + | " |
| + | " | ||
| + | [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], | ||
| + | [100.0, 1.0], [100.0, 0.0] ] | ||
| + | | ||
| + | } /* from http:// | ||
| inside_fences[] - list of fences currently " | inside_fences[] - list of fences currently " | ||
| </ | </ | ||
| | | ||
| - | Send an email on every fence crossing | + | Send an email on every fence crossing |
| < | < | ||
| if event.verb == " | if event.verb == " | ||
| Line 25: | Line 32: | ||
| </ | </ | ||
| - | Email Brennan after being at the Ace for more than 10 minutes | + | Send an email if I' |
| < | < | ||
| - | ace = fences[" | + | if (event.verb == " |
| - | if (event.verb == " | + | if ((new Date()) - fence.inside_trigger_time > 10.minutes) { |
| - | if (ace.inside_trigger_time | + | |
| email(" | email(" | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
| + | |||
geofencedsl.1295993681.txt.gz · Last modified: 2024/01/31 04:08 (external edit)