Follow Us

Tag Archive: APIs

We Have a Winner!

by

winnerLast week we celebrated our billionth API call by announcing a giveaway, and Tuesday we went ahead and pulled the name of a random API user who had made at least one successful query. I've been emailing with him since, and am please so say that Matt Gabrenya is our winner! You can find his Github profile here, and his business site, Boston TechCollective, here. Matt used our APIs to power his BillTrack project, which aims to make it easier to run advocacy campaigns on issues like SOPA and the Keystone XL pipeline. We're delighted that Matt found our APIs useful, and thrilled that thousands of you have as well. We're going to keep making them better, deeper and more powerful; we're counting on all of you to put them to good use.

Continue reading
Share This:

OpenGov Voices: Chasing the 8-hour app

by

Disclaimer: The opinions expressed by the guest blogger and those providing comments are theirs alone and do not reflect the opinions of the Sunlight Foundation or any employee thereof. Sunlight Tom MeagherFoundation is not responsible for the accuracy of any of the information within the guest blog.

Tom Meagher is the co-founder of Hack Jersey and the data editor at Digital First Media's Project Thunderdome in New York City. Follow Hack Jersey at @hackjersey or www.hackjersey.com. Reach Tom at @ultracasual.

A few weeks ago, Hack Jersey brought a group of journalists and developers together to wrestle with campaign finance data. We thought it would be a good opportunity for many to get their hands dirty and to start thinking about new ways of reporting and building with the data.

In one room of our event at the New Jersey Institute of Technology, a group of journalists went on a data expedition, learning how to explore reports from the state's Election Law Enforcement Commission. In another, we gathered developers to try to build a campaign finance app for New Jersey using the Sunlight Foundation's APIs in a single work session.

Continue reading
Share This:

What’s New in the Sunlight Congress API

by

In January, Sunlight [released a new Congress API](https://groups.google.com/forum/#!topic/sunlightlabs/r-evxgtFXRw). It's been a huge help to [our own products](http://congress.sunlightfoundation.com/), and seen a great deal of use by the community (such as today's [DefundTheNSA campaign](http://defundthensa.com/)). In the time since, we've released some new data, some new developer-friendly features, and seen lots of community contribution. Here's what's been added over the last few months:

Continue reading
Share This:

The Tech Behind Call on Congress

by

Call on Congress is the Sunlight Foundation's new free service to help anyone with a telephone connect with and learn about their lawmakers. Simply dial 1-888-907-6886 to find out how your representatives are voting on bills and raising campaign money and learn about upcoming bills in Congress.

While Sunlight prides itself on creating powerful, online tools that make government more transparent and accountable, we do so knowing that there is a segment of the public without access to the internet that we will never reach. Call on Congress is our attempt to bring information about Congress to anyone that can use a phone.

Twilio

The service is built on top of Twilio, a simple cloud communications API that enables us to create interactive phone and SMS applications. Users can navigate through a series of menus, be connected directly to the office of their representatives, and even leave us voice messages.

I can't express how awesome it is to work with their service. They have made it incredibly easy to do things that would otherwise be quite difficult to create. We can generate dynamic responses that are spoken back to the user using Twilio's text-to-speech feature. We can have recordings of a spoken script play for static content or even play music, if we had the need. We can even forward phone calls so that users can be connected directly to the office of their representative without having to write down the phone number and dial the call.

Twilio also has SMS features that, while not used on this project, are used on our other new service, Scout.

i18n and the Google Translate API

Call on Congress is Sunlight's first multilingual project. The service is available in English, Spanish, and Esperanto... yes, Esperanto. This posed some unique challenges as we had to deal with both a static spoken script and dynamic text that would be read using Twilio's text-to-speech feature.

Dan created an amazing, multi-tiered solution for this problem. Each bit of text used in the application is run through a series of steps to determine the proper response. All of the text is written in English in the code, but is internationalized by:

  • creating an MD5 hash of the text
  • determining the response language
  • checking for a cached translated copy of the text if it is not in English
  • generating a translated copy of the text using the Google Translate API
  • generating an audio file name based on the MD5 hash and a slugged chunk of the text
  • doing a HEAD request to S3 to see if an audio file exists for the chunk of text
  • responding either with a Twilio Say command using the translated chunk of text or a Play command with the S3 URL of the audio file, if one exists

This method allows us to basically drop in new languages as we create the audio for them. We can launch a new language and have the text-to-speech render the Google translated text until we drop language audio files into the application.

Dan is smart.

Sunlight APIs

One of the most exciting aspects about this project, at least for us internally, is that almost all of the features of this service are powered by our existing APIs:

Our friends at TurboVote are responsible for the API that allows us to provide information about local election offices.

Call on Congress is a great example of what can be done using our API offerings. We were able to create this application without having to do any scraping or collecting of data of our own. In fact, it's a great example of what can be done entirely with APIs. Call on Congress is nothing more than a cache and the logic that combines the Twilio, Google Translate, and Sunlight APIs into a single application.

Give it a try! 1-888-907-6886

Call on Congress is open source and available on GitHub.

Continue reading
Share This:

CFC (Combined Federal Campaign) Today 59063

Charity Navigator