Skip to content

A Java / Android client for Transport for London's Countdown live bus arrival time service

Notifications You must be signed in to change notification settings

eelpie/countdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 

Repository files navigation

A Java/Android client and model for TfL's Countdown bus arrival time service.

Example usage:

import uk.co.eelpieconsulting.countdown.model.Arrival;
import uk.co.eelpieconsulting.countdown.model.Stop;
import uk.co.eelpieconsulting.countdown.model.StopBoard;

final CountdownApi api = new CountdownApi("http://countdown.api.tfl.gov.uk");
		
// Load a list of stops within a circle
System.out.println("Searching for stops within circle");
List<Stop> stops = api.findStopsWithin(51.454, -0.351, 1000);
System.out.println("Found " + stops.size() + " stops");
Stop firstStop = stops.get(0);
System.out.println("This first one is: " + firstStop.getName() + " (" + firstStop.getId() + ") towards " + firstStop.getTowards() + " at " + firstStop.getLatitude() + ", " + firstStop.getLongitude());

// Load a list of expected arrivals for a stop
System.out.println("Loading arrivals for stop: " + firstStop.getId());
StopBoard stopBoard = api.getStopBoard(firstStop.getId());
Arrival firstArrival = stopBoard.getArrivals().get(0);
System.out.println("Next arrival is " + firstArrival.getRouteName() + " to " + firstArrival.getDestination() + ": " + firstArrival.getEstimatedWait());
System.out.println("Last updated: " + stopBoard.getLastUpdated());


Output:
Searching for stops within circle
Found 39 stops
This first one is: Tayben Avenue (55688) towards Fulwell or Isleworth at 51.454234, -0.342136
Loading arrivals for stop: 55688
Next arrival is 281 to Tolworth: 1339102817000
Last updated: 1339102411323


About

A Java / Android client for Transport for London's Countdown live bus arrival time service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages