Bus Predictions with Alexa
During local hack day this December, I developed an Alexa skill for students to check bus times through campus transportation. It was a solo project I set out to complete in 10 hours, and as of January of 2019, over 30 students are still actively invoking the skill every week.
The process of building Alexa skills has changed a lot over time, but when this skill was created, the “Skill Builder” was still in beta. So instead, I just used an AWS Lambda function to control requests to our transportations API.
I never earned an API key, but luckily, using “XXXX” (the key that was used in the demonstration documentation page), allowed for unlimited requests :). In writing this post, I found their developer facebook page and API documentation, and they’ve acknowledged the public key and now encourage developers to use it.
Interacting with the API ● GitHub ● Alexa Skill
Below is the script I used to interact with the Bongo API. As of January 2019, it still works, so feel free to use it in your own projects!
The lambda function version I used for the Alexa Skill is also available as a separate script on the GitHub repo. It’s a great beginners project because it could easily be turned into a full wrapper, and the skill has many more potential improvements, so feel free to make pull requests!
import json, urllib.request