User Tools

Site Tools


geofencedsl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
geofencedsl [2011/01/25 22:23] donpdonpgeofencedsl [2024/01/31 04:08] (current) – external edit 127.0.0.1
Line 1: Line 1:
 == GeoFence DSL == == GeoFence DSL ==
  
-javascript language.+Allow users to write javascript to do what they want to with geofence events. 
 +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.
  
  
Line 23: Line 25:
 </code> </code>
      
-Send an email on every fence crossing+Send an email on every fence crossing (blob attached to the user)
 <code> <code>
  if event.verb == "IN" {  if event.verb == "IN" {
Line 30: Line 32:
 </code> </code>
  
-Email Brennan after being at the Ace for more than 10 minutes+Send an email if I'at the ACE for 10 minutes (blob attached to the fence)
 <code> <code>
- ace = fences["Ace Hotel"+ if (event.verb == "IN") { 
- if (event.verb == "IN" && event.fence == ace) { +    if ((new Date()) - fence.inside_trigger_time > 10.minutes) {
-    if ((new Date()) - ace.inside_trigger_time > 10.minutes) {+
       email("brennan", "Nerdout at the ACE Hotel!")       email("brennan", "Nerdout at the ACE Hotel!")
     }     }
  }  }
 </code> </code>
 +
geofencedsl.1295994189.txt.gz · Last modified: 2024/01/31 04:08 (external edit)