This project polls the BusTime api for when a bus is within range of a stop and sends an SMS text. It uses Spray and Akka for the endpoints and logic. SMS are sent using TextBelt
Follow these steps to get started:
-
The following configuration settings are passed to the application by environment variables. They can also be set explicitly in the
application.conf
-
BUS_TIME_API_KEY
-
BUS_STOP_ID
-
SMS_NUMBER
-
EXPRESS_BUS_LINE (this is optional if an express bus also visits the stop)
-
Change directory into your clone:
$ cd my-project
-
Launch SBT:
$ sbt
-
Start the application:
> re-start
-
Browse to http://localhost:8080
-
Stop the application:
> re-stop
To run on a raspberry pi (requires jvm
installed. For reasons I did not look into I had trouble running it with Java8):
-
Create assembly jar:
$ sbt assembly
-
Copy created jar file to the raspberry pi
-
Set above environment variables if not explicitly specified in
application.conf
-
Start the application:
$ java -Xss1M -Xms64M -jar spray-bus-alerter-assembly-0.1.jar
This project was in part inspired by Control Group's work on the MTA kiosks.