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:13] – 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 (blob attached to the user) | ||
< | < | ||
if event.verb == " | if event.verb == " | ||
Line 24: | Line 32: | ||
</ | </ | ||
+ | Send an email if I'm at the ACE for 10 minutes (blob attached to the fence) | ||
< | < | ||
- | 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.txt · Last modified: 2024/01/31 04:08 by 127.0.0.1