diff --git a/README.md b/README.md deleted file mode 100644 index a469fa4..0000000 --- a/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Hackathon-Python -Repository for python submissions for Zense Hackathon 2021 -You have to make your python submission pull request to this repository. - -Message from Vikas Yadav: Founder of Zense - -Hi folks, - -Very happy to see this hackathon happening again. While on campus I loved being part of events like these. A lot of my interests developed as side effects of these events. With that in mind and to encourage the spirit of innovation - I would like to announce a bonus prize of Rs 5000 from my side for the idea which I find the best. In case it's difficult to decide a single winner - please don't mind if I split the prize into two. - -Parameters I am going to judge you on: -- Feasibility of the idea -- Completeness of the implementation -- Effort you put in -- Impact of the idea - -Some potential ideas you can think of: -- Automate a mundane task which you might have to everyday using python -- Explore the python ecosystem to find some amazing libraries - use it to solve a real-world problem around you -- Or just make something cool - - -And it's not just about the award, if you are interested after the hackathon to pursue your idea further I would be happy to mentor. - -Regards, -Vikas - diff --git a/hack.py b/hack.py new file mode 100644 index 0000000..759a105 --- /dev/null +++ b/hack.py @@ -0,0 +1,40 @@ +from selenium import webdriver +from selenium.webdriver.common.keys import Keys +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.common.by import By +from selenium.webdriver.common.action_chains import ActionChains +import time +import pyautogui +from selenium.webdriver.remote.file_detector import UselessFileDetector + +x=400 +y=254 + +email = (By.ID,"i0116") +next = (By.ID,"idSIButton9") +passw = (By.ID,"i0118") + +driver = webdriver.Chrome("/usr/local/bin/chromedriver") +driver.maximize_window() + +driver.get("https://login.microsoftonline.com/dec2e631-d656-473c-afff-447008969d2f/oauth2/authorize?client_id=00000003-0000-0ff1-ce00-000000000000&response_mode=form_post&protectedtoken=true&response_type=code%20id_token&resource=00000003-0000-0ff1-ce00-000000000000&scope=openid&nonce=06A7E8476B916E5B799822719B418D164BB2D44BD22D80C1-6069B6B8341E670EF89F50F100919AEE505D098F67BE8C81A6F28AE14DDB2F5D&redirect_uri=https%3A%2F%2Fiiitborg-my.sharepoint.com%2F_forms%2Fdefault.aspx&claims=%7B%22id_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D&wsucxt=1&cobrandid=11bd8083-87e0-41b5-bb78-0bc43c8a8e8a&client-request-id=f623b69f-f0ae-0000-83c3-75b9b18bdad3") + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(email)).send_keys("") #FILL IN YOUR EMAIL ACCOUNT WITHIN THE QUOATATION MARKS + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(passw)).send_keys("") # FILL IN YOUR PASSWORD WITHIN THE QUOATION MARKS + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +da = driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/div/div/div/div[2]/div[1]/div/div/div/div/div/div[1]/div[2]/button') + +action = ActionChains(driver) + +action.move_to_element(da).click().perform() + +time.sleep(2) +pyautogui.click(x,y) diff --git a/project-details.md b/project-details.md new file mode 100644 index 0000000..316d702 --- /dev/null +++ b/project-details.md @@ -0,0 +1,30 @@ + +## Video + +Here's a video for you to watch the accomplishment of my code ------>(https://youtu.be/T9DVo9yyNSI) (the video is unlisted). + +## Dependencies + +selenium,pyautogui,time modules. + +## Installation + +How to install on Linux... + + You are required to download the Chrome Driver from https://chromedriver.storage.googleapis.com/index.html?path=89.0.4389.23/ . + Install Selenium using the ```pip3 install selenium``` ( Check this out if you are stuck anywhere--->(https://youtu.be/67h3IT2lm40)). + Install pyautogui using ```python3 -m pip install pyautogui``` . + +## Usage + +This is an incomplete project which was used to upload any file to your onedrive business account. (Yes there are api's for it,but your administrator might not allow you to create an application for your business account.) + +The code manages to open the Open File Dialog Box for you to select the required file to upload it on to your ondrive .(90% of the code is done) + +Further modificitaions can be made to the code such that when provided with the login credentials and the file path, the code can manage to upload the specified file automatically. + +At the very least,the code can be used as very simple password manager which autlogin's you to your accounts whith small modifications. + +## Contribution SetUp + +You can combine the code with javascript to overcome the Open File Dialog Box. Check this out --->(https://stackoverflow.com/questions/62211837/how-to-avoid-the-open-file-dialog-box-by-uploading-the-file-directly-with-python/62219380#62219380).