Created
February 13, 2015 22:45
-
-
Save cvengros/81319530e7bf25e8631f to your computer and use it in GitHub Desktop.
sharepoint downloader
This file contains hidden or 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
require 'csv' | |
require_relative 'sharepoint_downloader' | |
# variables | |
client_id = ENV['CLIENT_ID'] | |
client_secret = ENV['CLIENT_SECRET'] | |
refresh_token = ENV['REFRESH_TOKEN'] | |
resource = ENV['RESOURCE'] | |
site_url = 'https://boozallen.sharepoint.com' | |
source_id = 'b09a7990-05ea-4af9-81ef-edfab16c4e31' | |
properties = 'AccountName,BAHIMT,BAHAccountGroup,Department,BAHOfficeCity,BAHOfficeState,BAHOfficeCountry,JobTitle,BAHCluster,BAHCareerTrack,BAHCertifications,WorkEmail,BAHFCPrimary,BAHGroup,BAHIMT,BAHLanguages,JobTitle,BAHOffice,PreferredName,Group,BAHProposalExperience,BAHRC,BAHRolePrimary,BAHSkills,BAHFCPrimary' | |
csv_path = 'data.csv' | |
page_size = 100 | |
downloader = SharepointDownloder.new( | |
:client_id => client_id, | |
:client_secret => client_secret, | |
:refresh_token => refresh_token, | |
:resource => resource, | |
:site_url => site_url, | |
:source_id => source_id, | |
:page_size => page_size, | |
) | |
downloader.download_all(csv_path, properties) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment