Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@whamtet
Created July 11, 2017 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whamtet/a9f7c6121d721be775acbb851ed9a40f to your computer and use it in GitHub Desktop.
Save whamtet/a9f7c6121d721be775acbb851ed9a40f to your computer and use it in GitHub Desktop.
(ns analyze.spit-sheets)
(import com.google.api.services.sheets.v4.SheetsScopes)
(require 'google-apps-clj.credentials)
(require '[google-apps-clj.google-sheets-v4 :as gs4])
(def scopes [SheetsScopes/DRIVE SheetsScopes/SPREADSHEETS])
(def creds (google-apps-clj.credentials/default-credential scopes))
;(println (gd/list-files! creds "0BxDSmBQ-JH6xLTZ5R3psbkUzNEE"))
(def service (gs4/build-service creds))
(def spreadsheet "1C8GRZHsOQkh8tevMjEs1N_pq8khDvs3WluLBzD8ruF4")
(def worksheet (-> (gs4/get-spreadsheet-info service spreadsheet)
(get "sheets")
first
(get "properties")
(get "sheetId")))
(defn spit-sheet [data]
(gs4/write-sheet service spreadsheet worksheet data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment