Skip to content

Instantly share code, notes, and snippets.

@AumCoin
Created September 30, 2019 23:07
Show Gist options
  • Save AumCoin/9833070cab3499e6bf5bd76e207f8076 to your computer and use it in GitHub Desktop.
Save AumCoin/9833070cab3499e6bf5bd76e207f8076 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require "rubygems"
require "json"
require "faraday"
require "csv"
require "google/apis/drive_v3"
require "googleauth"
require "googleauth/stores/file_token_store"
require "fileutils"
#Drive = Google::Apis::DriveV3 # Alias the module
#drive = Drive::DriveService.new
#drive.get_file("1gGSCURCWTbMrI9_KxhAhxJcIqxdvtSurYK9CRFo3EBY", download_dest: '/scripts/sales-overage-calculator/temp.csv')
Drive = Google::Apis::DriveV3 # Alias the module
drive_service = Drive::DriveService.new
file_id = '1gGSCURCWTbMrI9_KxhAhxJcIqxdvtSurYK9CRFo3EBY'
content = drive_service.export_file(file_id,
'text/csv',
download_dest: "/scripts/sales-overage-calculator/out.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment