Created
September 30, 2019 23:07
-
-
Save AumCoin/9833070cab3499e6bf5bd76e207f8076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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