Bot-Brainstorm

Brainstorm the ideas for five different data-focused bots. You don’t actually have to build them, just think of ideas that you might want to do for the final project, alone, or with a partner.

Rubric

Points: 20

Due date: 2017-03-07

Deliverables

Email dun@stanford.edu with the subject line:

compciv-2017::your_sunet_id::bot-brainstorm

And attach 5 text files, bot1.txt to bot5.txt

Requirements

Each text writeup has these sections:

  • Description: just a couple of lines describing what the bot does.
  • The Arguments: What are the values the bot will take as input, e.g. a location, or date, or some other value that will affect what the bot calculates.
  • Data sources: descriptions, including links, to at least 3 different datasets or APIs that the bot will draw from.
  • Data transformations: descriptions of what the bot will do to the data to find insights, e.g. sorting, filtering, transforming.
  • The Story: a rough template of what the bot will publish. This is not the same as how or where it publishes (e.g. to Twitter, or Reddit, or to a website).
  • References: links to any other useful resources, or inspirations.

Example writeups

Example: Your Congressmember’s Latest Votes

Given a user’s home location, finds out who their Congressmembers are (both Senators and House member), and what their latest roll call votes are, and their email address and phone numbers.

Arguments

The user’s home location, e.g. “Menlo Park, CA, 94025”

Data sources

Data transformations

  • Converting human-readable address or location to latitude/longitude (i.e. geocoding)
  • Filtering Congress roll for legislators who represent a given geography
  • Filtering votes by Congressmember, sorting by most recent

Example story

If the user puts inputs “100 University Ave, Palo Alto, CA”

A possible story might be:

For the address of:
100 University Ave, Palo Alto, CA

The likely House representative is:
Rohit Khanna, Democrat, CA-17
https://khanna.house.gov/
555-867-5309

The U.S. Senators for CA are:

Diane Feinstein, Democrat
http://www.feinstein.senate.gov/public/
555-222-3333

Kamala Harris, Democrat
https://www.harris.senate.gov/
555-777-9999

Latest votes:

Khanna:

2017-02-12: HR 101 - "Standard Equal Rules Act of 2016
Yes

2017-02-01: HR 101 - "Super Patriot Act"
No

2017-01-25: HR 101 - "Cookies Taste Good Act"
Yes


(etc for the Senators)

Inspirations

ProPublica app for finding your legislators my address/zip code, as well as a listing of major votes:

https://projects.propublica.org/represent/

Who Represents You in the U.S. Congress: http://www.whoismyrepresentative.com/

Example: Officer-involved shootings near you

Description

Given a user’s human-readable location (e.g. “Stanford University”), this bot produces a message listing the 5 closest officer-involved shootings, as well as a locator map showing the user’s location in relation to those 5 incidents, and a Google Street View Map for each shooting location.

Arguments

The bot takes in one argument: the user’s location/address, e.g. “Omaha, Nebraska”

Data sources

(note: as it turns out, the Washington Post may not be the best place to get this data as they don’t have it down to the address level)

Data transformations

  • Translate a human-readable address into geospatial coordinates, e.g. ``

100 W Broadway, Council Bluffs, IA`` into the latitude/longitude values of 41.238,``-95.854``, i.e. “geocode” - Geocode each of the Washington Post police shootings incidents, i.e. create a new dataset with latitude and longitude columns. - Sort the police shootings by distance to a given point (use the haversine formula once everything has been geocoded) - Given a location string, produce the equivalent Street View Image and STatic Maps API URLs

Example story

Here is a map of the 3 nearest fatal police shootings to Stanford University, California, since 2015:


https://maps.googleapis.com/maps/api/staticmap?size=650x400&markers=Stanford+University,CA&markers=Palo+Alto,CA


1. John Doe, 28, unarmed white male shot in Palo Alto, California, on March 10, 2016

https://maps.googleapis.com/maps/api/streetview?size=600x400&location=Palo+Alto,CA

2. Sally Doe, 56, armed Asian female shot in Menlo Park, California, on February 10, 2016:

https://maps.googleapis.com/maps/api/streetview?size=600x400&location=Menlo+Park,CA

3.  Nick Doe, 42, unarmed black male shot in Sacramento, California, on February 10, 2015: https://maps.googleapis.com/maps/api/streetview?size=600x400&location=Sacramento,CA

References/Inspirations

The Officer Involved project, by Josh Begley, data artist for the Intercept, is an array of street view images geocoded to the recorded address of a fatal police encounter:

https://theintercept.co/officer-involved/

Reading about bots

Read these examples/anecdotes/case studies over the weekend:

The Best Bots

Bots that have a beginning and end and/or a determined path

Bots that react to user (i.e. external) input/activation

Bots that monitor a stream of data, or subscribe to a source of “push notifications”

Bots that just do their own things