lib/zonar.rb
# gets past locations for a single bus
gets past locations for a single bus
gets past locations for a single bus
def path(fleet_id, since=900)
      now = Time.now.to_i
      past = now - since 
      params = {:username => @username, :password => @password, :action => 'showposition', :type => "Standard", :version => "2", :logvers => "3", :operation => 'path', :format => 'json', :reqtype => "fleet", :target => fleet_id.gsub(' ', '%20'), :starttime => past, :endtime => now}
      fetch(params)
    end
def path ( fleet_id , since = 900 ) now = Time . now . to_i past = now - since params = { :username => @username , :password => @password , :action => 'showposition' , :type => "Standard" , :version => "2" , :logvers => "3" , :operation => 'path' , :format => 'json' , :reqtype => "fleet" , :target => fleet_id . gsub ( ' ' , '%20' ) , :starttime => past , :endtime => now } fetch ( params ) end
gets past locations for a single bus
gets past locations for a single bus
# default 900 = 15 minutes ago
fleet_id
<not_specific>
since
<not_specific>