18F/foia — pull request #4 by konklone (2014-06-16 17:07:31+00:00)
Title: Downloading FOIA contact info for federal agencies

(This is a **work-in-progress** PR, not meant yet for merging.)

I'm downloading agency contact information for FOIA, from the [FOIA.gov request form](http://www.foia.gov/report-makerequest.html). It has a table of contacts:

![foia-1](https://cloud.githubusercontent.com/assets/4592/3290432/2ebd7816-f578-11e3-9548-bccf1be1221e.png)

That when selected, bring you to another dropdown:

![foia-3](https://cloud.githubusercontent.com/assets/4592/3290441/44e235fa-f578-11e3-9a96-0d1cdf9762e1.png)

And when a department is selected, it shows you full contact info:

![foia-4](https://cloud.githubusercontent.com/assets/4592/3290444/4afd2760-f578-11e3-9216-f803d1a9d36e.png)

`contacts.rb` uses the AJAX endpoints behind this process to load contact info, by downloading their HTML to the `html/` directory (unversioned). It then parses the contact details out of them, and makes YAML files in the `data/` directory (versioned).

Data looks like this so far:

```yaml
---
abbreviation: U.S. CPSC
name: Consumer Product Safety Commission
description: The U.S. Consumer Product Safety Commission is charged with protecting
the public from unreasonable risks of injury or death from thousands of types of
consumer products under the agency's jurisdiction.
departments:
- name: Consumer Product Safety Commission
```

More to come before merging.

## Why do this?

The [FOIA.gov developer page](http://www.foia.gov/developer.html) has an [Excel spreadsheet](http://www.foia.gov/full-foia-contacts.xls) of contact info, but it is very incomplete.

This data is meant to be a starting point -- something that can be easily corrected, expanded, and repurposed. Perhaps someday it should be moved to its own repo, where it can become the canonical dataset for FOIA contact information in the US federal government.