Inspiration
I thought that the FiscalNote data/API seemed interesting to work with,
What it does
The two project files are getcode2.html and codespec.html. getcode2 links to codespec.
You type in a first, or last name, but not both, of a legislator. This is put into a query to the Fiscalnote API, and various relevant data is returned. Allows for fast and immediate identification of facts that are of interest to the layperson. Also
How I built it
This is a html based hack, with embedded javascript scripts doing the heavy lifting. The 'frontend' getcode2 allows the input of a value into a textbox, which is then stored into a variable which persists across a change in webpage. The stored variable is then used as a query to the FiscalNote API. The API returns a big ol JSON object, which is a pain to manually look through. The program then extracts relevant variables, and displays them in a text box. A nice picture of the politician you are looking up pops up as well.
Challenges I ran into
In chrome the error message "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access." Development continued in safari.
urlencoding of + symbols into %2B stopped the development of multi word searches. extraction of the photo url to display as an image
Sometimes it takes a while to connect to the Api. Such is life.
Accomplishments that I'm proud of
The fact that the project works -connecting to the API and extracting usable data after mishaps with JSONP encoding. -the fact that a photo actually displays
extracting the photo url from the data was hard, because the variable i would save it as would not be compatible with the src="" part of the image tag. I ended up reading it into a hidden directory, and then reading it back out, catenating it with the <img src= part of the script, and placing it into another directory.
What I learned
How 2 code better. My last experience coding was with java in middle school, but I got a handle on dealing with JSON objects and Jquery now.
What's next for FiscalNote Reader
Expansion into reading other FiscalNote databases: commitees, bills, etc Improvement on interface, Greater information display. Increased search tolerance. Statistical analysis and interaction with the "friends" and "effectiveness" data.
Log in or sign up for Devpost to join the conversation.