Skip to content

Instantly share code, notes, and snippets.

@mikeda
Created July 7, 2013 06:07
Show Gist options
  • Select an option

  • Save mikeda/5942491 to your computer and use it in GitHub Desktop.

Select an option

Save mikeda/5942491 to your computer and use it in GitHub Desktop.
rubyからGoogle SpreadSheetをいじるサンプル
#!/home/mikeda/.rbenv/shims/ruby
# -*- coding: utf-8 -*-
require 'google_drive'
session = GoogleDrive.login("<user>@gmail.com", "<password>")
#session.files.each do |file|
# p file.title
#end
ss_title = 'test_ss'
ws_title = 'test_ws'
ss = session.spreadsheet_by_title(ss_title) || session.create_spreadsheet(ss_title)
ws = ss.worksheet_by_title(ws_title) || ss.add_worksheet(ws_title)
ws[1,1] = "aaa"
ws.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment