Skip to content

Instantly share code, notes, and snippets.

@alea12
Created February 12, 2016 00:06

Revisions

  1. alea12 created this gist Feb 12, 2016.
    13 changes: 13 additions & 0 deletions gd.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    require "google/api_client"
    require "google_drive"
    session = GoogleDrive.saved_session("config.json")
    ws = session.spreadsheet_by_key("pz7XtlQC-PYx-jrVMJErTcg").worksheets[0]

    # Gets content of A2 cell.
    p ws[2, 1] #==> "hoge"

    # Changes content of cells.
    # Changes are not sent to the server until you call ws.save().
    ws[2, 1] = "foo"
    ws[2, 2] = "bar"
    ws.save