avoinministerio/avoinministerio — pull request #145 by jyrkive (2012-05-18 12:05:01+00:00)
Title: Ability to export the list of users to a CSV file

These commits add a new method, Citizen.export_to_csv. The method exports the list of users into a CSV file and uploads the file to the Amazon Simple Storage Service. You can specify the bucket name and the object name. When the method ends, it prints the URL where you can download the file.

## Security warning ##

**The method exports the entire list of users, complete with real names and email addresses.** When you call the method from the console, make sure that you use an Amazon AWS account whose credentials no one else knows. Similarly, if you add a way to export the list of users via the UI, make sure that only people who we really trust are able to use that function.

## API ##

> (nil) export_to_csv(bucket_name, object_name, options = {})

### Parameters ###

+ bucket_name: Name of the bucket that you want to use. The bucket must exist already.
+ object_name: Name of the object. The method will create the object if it doesn't exist yet.

#### Mandatory options ####

+ :access_key_id: Amazon AWS access key ID.
+ :secret_access_key: Amazon AWS secret access key.

### Example ###

> Citizen.export_to_csv(
>> 'avoinministerio',
>> 'kansalaiset.csv',
>> :access_key_id => 'ABC',
>> :secret_access_key => '123'

> )