Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mericson/tablespoon
Use Google Spreadsheets as your CMS
https://github.com/mericson/tablespoon
Last synced: about 2 months ago
JSON representation
Use Google Spreadsheets as your CMS
- Host: GitHub
- URL: https://github.com/mericson/tablespoon
- Owner: mericson
- License: other
- Created: 2013-01-25T01:01:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-27T17:40:50.000Z (over 10 years ago)
- Last Synced: 2024-07-17T06:32:14.160Z (2 months ago)
- Language: Ruby
- Size: 195 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE.txt
Awesome Lists containing this project
README
= tablespoon
Access Google Spreadsheets in a vaguely record-like way.
== Requirements
* Google Spreadsheet that is organized like a database table. Fieldnames in the first row, records in the rest of the rows.== Installation
sudo gem install tablespoon
== How to Use
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']
endModify fields and save data back to the spreadsheet.
rows.each do |r|
r['full-name'] = r['full-name'].upcase
end
== Copyright
Copyright (c) 2013 Matt Ericson. See LICENSE.txt for
further details.