Access Google Spreadsheets in a vaguely record-like way.
-
Google Spreadsheet that is organized like a database table. Fieldnames in the first row, records in the rest of the rows.
sudo gem install tablespoon
require 'rubygems' require 'tablespoon'
Connect to a Google doc
doc = Tablespoon::Doc.new( "0ArhhvPZdTe-WdGpZQ3pEY1hDcEUxWmxwNnJEQ3g4aVE", :username => google_username, :password => google_password )
Get a worksheet either by name or by id. (Coming soon: Optionally, declare an id field so you can find rows by id later.)
rows = doc.get_table 'Sheet1', :id_field => 'last-name'
Loop thru rows and retrieve data
rows.each do |r| puts r['full-name'] end
Modify fields and save data back to the spreadsheet.
rows.each do |r| r['full-name'] = r['full-name'].upcase end
Copyright © 2013 Matt Ericson. See LICENSE.txt for further details.