Advertisement
Guest User

Untitled

a guest
Sep 30th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. require "rubygems"
  4. require "json"
  5. require "faraday"
  6. require "csv"
  7. require "google/apis/drive_v3"
  8. require "googleauth"
  9. require "googleauth/stores/file_token_store"
  10. require "fileutils"
  11.  
  12. #Drive = Google::Apis::DriveV3 # Alias the module
  13. #drive = Drive::DriveService.new
  14. #drive.get_file("1gGSCURCWTbMrI9_KxhAhxJcIqxdvtSurYK9CRFo3EBY", download_dest: '/scripts/sales-overage-calculator/temp.csv')
  15.  
  16. Drive = Google::Apis::DriveV3 # Alias the module
  17. drive_service = Drive::DriveService.new
  18.  
  19. file_id = '1gGSCURCWTbMrI9_KxhAhxJcIqxdvtSurYK9CRFo3EBY'
  20. content = drive_service.export_file(file_id,
  21. 'text/csv',
  22. download_dest: "/scripts/sales-overage-calculator/out.csv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement