geofencedsl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
geofencedsl [2011/01/25 22:12] – 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. | ||
Variables | Variables | ||
< | < | ||
- | detail | + | 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 = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | [ [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) | ||
< | < | ||
- | | + | |
email(" | email(" | ||
} | } | ||
</ | </ | ||
+ | Send an email if I'm at the ACE for 10 minutes (blob attached to the fence) | ||
< | < | ||
- | ace = fences[" | + | if (event.verb == " |
- | if (detail.verb == " | + | if ((new Date()) |
- | if (ace.inside_trigger_date | + | |
email(" | email(" | ||
} | } | ||
} | } | ||
</ | </ | ||
+ |
geofencedsl.txt · Last modified: 2024/01/31 04:08 by 127.0.0.1