StayWokeOrg / general-congress-hotline

7 stars 26 forks source link

Support for calling state representatives #6

Open typpo opened 7 years ago

typpo commented 7 years ago

There may be APIs to handle this.

https://sunlightlabs.github.io/openstates-api/

diffalot commented 7 years ago

I've done a little work with the open states api while building https://mississippi.wtf, and I have a few questions about how this should be implemented:

  1. Due to gerrymandering, state level reps cannot be retrieved from just a zip code, it requires the full lat/long geo coordinates. The way I handled getting the lat/long was to use a Google API to gather that data from an address, then find the reps with the OpenStates API. How are we going to have users enter this over the telephone? Can we use IBM Watson (or something else) to do voice recognition to ask users to speak their address?
  2. In testing out the data for Mississippi, I found that many representatives do not provide contact phone numbers. How does the system handle a rep that does not provide a contact number?
typpo commented 7 years ago

1) This is a really good point. My hunch is that voice recognition would be error-prone, even if we did hook into something like Google's Speech API. We may have to hold off on this unless we build other "Call Congress" interfaces that allow for address inputs or precise location. Or, we can experiment - I've used Google's Speech API before and it works pretty well.

2) AFAIK everyone has a phone number at the federal level. At the state level, we may have to crowdsource phone numbers or other sorts of contact information if phone numbers are not readily available via API. In order to make this problem tractable, we may have to start by targeting specific states first as issues come up.

diffalot commented 7 years ago
  1. I'll try adding in a voice-recognition controller and a menu to perform a voice search for the lat/long. I'll make it so that we can easily switch between Watson and the Google Speech API. I think it'd be fun to test those two out. I'll try running it on a my own servers and request testing from slack users. Once/If it works well we can figure out how to merge it in.

  2. I'd guess that 80% of reps have phone numbers, so skipping a rep seems like a good option in the call queue. We can pick up the missing reps later (via crowdsourcing) and just provide a message to user that we're skipping a rep because they don't have a number for now.

typpo commented 7 years ago

Sounds good. Excited to see how the speech APIs work!

typpo commented 7 years ago

@diffalot I think someone mentioned this in chat, but one way to neatly handle the address geolocation problem is to ask people to text us their address. Once they text their address, we immediately call them and go through the normal flow (minus zip code prompt).