def add_rides(self, start, end, nosave): client = Client(access_token=self.__token) url = 'https://social.cern.ch/community/BikeCommuters' opener = basic_auth_opener(url, self.__user, self.__pass) site = SharePointSite(url, opener) cal = site.lists["Calendar"] total = 0 for activity in client.get_activities(before=end, after=start): if not activity.commute: continue print("adding ride on {}".format(activity.start_date)) cal.append({ 'Date': activity.start_date, 'Distance': float(activity.distance) / 1000 }) total += float(activity.distance) / 1000 print("added {} km".format(total)) if nosave: return cal.save()
from sharepoint import SharePointSite, basic_auth_opener server_url = "scout.ironmountain.com" site_url = server_url + "/functions/globalservices/IT" opener = basic_auth_opener(server_url, 'slogandurai', 'Aug2018!') site = SharePointSite(site_url, opener) for sp_list in site.lists: print(sp_list.id, sp_list.meta['Title'])
for link in links: r = requests.head(link.get_attribute('href')) print(link.get_attribute('href'), r.status_code) ####################################################################################################################### from sharepoint import SharePointSite, basic_auth_opener import requests from selenium import webdriver from selenium.webdriver.common.keys import Keys import os import time server_url = "https://thehub.group.atlascopco.com/" site_url = server_url + "teams/TOO_NACKA/RD/SitePages/Solution%20verification%20internal.aspx" opener = basic_auth_opener(server_url, "TOOau", "June@20") #"TOOanau", "June@2018") site = SharePointSite(site_url, opener) site.as_xml() ''''' options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') options.add_argument('--ignore-ssl-errors') dir_path = os.path.dirname(os.path.realpath(__file__)) chromedriver = dir_path + "/chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chrome_options=options, executable_path=chromedriver) driver.get(site) time.sleep(2) driver.close()
def __init__(self, host, username, password): self.host = host self.opener = basic_auth_opener(host, username, password)
def set_basic_auth(self, username, password): self.opener = basic_auth_opener(self.host, username, password)
import sharepoint as sp server_url = r'https://markettrackllc.sharepoint.com/' #Team Action Items site_url = server_url + r'sites/SolonAdOps/Team%20Sites/coverage&collections/Lists/Team%20Action%20Items/allitems.aspx' #Documents (this is where BAM lives) site_url = server_url + r'sites/SolonAdOps/Team%20Sites/coverage%26collections/Shared%20Documents/Forms/AllItems.aspx?viewpath=%2Fsites%2FSolonAdOps%2FTeam%20Sites%2Fcoverage%26collections%2FShared%20Documents%2FForms%2FAllItems.aspx' username = '******' pw = '''het4W8<U''' opener = sp.basic_auth_opener(server_url, username, pw) site = sp.SharePointSite(site_url, opener) for sp_list in site.lists: print(sp_list.id, sp_list.meta['Title'])
def submit(request): site_url = request.GET['URL'] opener = basic_auth_opener(site_url,'*****@*****.**','Gokhul1809??') site = SharePointSite(site_url,opener) return render(request,'result.html',{'result':site})