Activity 11: Using the CUMTD API
Due: On git by Thursday, Nov. 3, 2016 at 11:00am
Team: This is a solo assignment; you should type all the code to your solution. However, feel free to get help from others/Google/etc.
Grading: This assignment is the mid-week activity for Experience 8, worth 10 points. There is no partial credit.

Introduction

Today, we took a field trip! We took the 22 Illini from the Ceramics Building to the Transit Plaza and took a detailed look at the information signs that display bus route data.

In this activity, you will recreate a simple version of this sign.


Part 1: Setup

For this activity, you will be working in the exp_cumtd directory. You can merge it using the following:

git fetch release
git merge release/exp_cumtd master -m "merge"

Additionally, you will need your own CUMTD API key. You must add your CUMTD API key to your workbook, which you can do by following these steps:

  • Visit https://developer.cumtd.com/, scrolling down to nearly the bottom until you see the header Get an API Key.
  • Fill out a name and valid e-mail address. (I used by @illinois.edu address.)
  • Check your e-mail and click the link in your e-mail to activate the key. The key must be activated in order to work.
  • In your CS 205 Workbook, navigate into the static directory, then into the keys directory, and open cumtd.txt. Copy and paste your key into cumtd.txt (this file will be used every time we make a CUMTD API request).

Part 2: Understanding a CUMTD API Request

Using the Lecture Handout for Nov. 1, make a CUMTD API request using your web browser. The base URL for this request is https://developer.cumtd.com/api/v2.2/json/GetDeparturesByStop and two query-string parameters are required (outlined just above "Puzzle #1").

A successful request for a popular stop (ex: IU) will respond with a large amount of JSON. This part does not require any Python.


Part 3: Using Python to make a CUMTD API Request

Continue onto the backside of the lecture handout. The code is provided for you to complete this part as part of the handout.

You should print(data) in Python to ensure that you're recieving JSON back from CUMTD.


Part 4: Creating a JSON for visualization

Finally, complete the last half-page of the lecture handout. You must create the code to output an array of dictionaries, where each dictionary contains the route and expected for every bus.

When this is complete, you will see a simple visualization in your workbook!


Submission

This activity is submitted digitally via git. View detailed submission instructions here.