An example of how to extract spreadsheet data from google drive.
Set up a new application at https://console.developers.google.com/. Note its name.
Under APIs & auth > APIs, enable the Drive API.
Under APIs & auth > Credentials, add credentials for a service account. Download a .p12
file, note its name, and store it in the root directory of this repository. Note the service account's email address.
Open your Google Sheet. Note its id
by inspecting its url.
docs.google.com/spreadsheets/d/
id
/edit.
Share the Google Sheet with the service account's email address in a "can edit" role.
Clone the repo.
git clone [email protected]:0d38648e5f23ab839d05.git
cd 0d38648e5f23ab839d05
Install gem dependencies.
bundle install
Edit the configuration methods at the top of google_driver.rb
, specifying your api keys, file id, and a custom code snippet to execute for each row.
Run the extraction script.
ruby google_driver.rb