From 725aeea062f31596598dbc1e99863ad7cde6e745 Mon Sep 17 00:00:00 2001 From: srinivas <74464272+srinivas9110322@users.noreply.github.com> Date: Sun, 21 Mar 2021 20:38:28 +0530 Subject: [PATCH 1/5] Add files via upload --- hack.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 hack.py diff --git a/hack.py b/hack.py new file mode 100644 index 0000000..f4c9336 --- /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("Srinivasa.Bhargava@iiitb.org") + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(passw)).send_keys("Z-G%855h=iDEGXe") + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +WebDriverWait(driver,10).until(EC.element_to_be_clickable(next)).click() + +manda = 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(manda).click().perform() + +time.sleep(2) +pyautogui.click(x,y) From ab901c3c72b80f6175e47e2ca9bedfbc56384c0a Mon Sep 17 00:00:00 2001 From: srinivas <74464272+srinivas9110322@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:00:57 +0530 Subject: [PATCH 2/5] Update README.md --- README.md | 58 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a469fa4..555ebae 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,49 @@ -# Hackathon-Python -Repository for python submissions for Zense Hackathon 2021 -You have to make your python submission pull request to this repository. +$ python3 -m pip install pyautogui# Onedrive Uploader Python Script -Message from Vikas Yadav: Founder of Zense +Include any project badges (e.g. CI) here at the top. -Hi folks, +Description of project & its goals. -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. +The code is incomplete as -Parameters I am going to judge you on: -- Feasibility of the idea -- Completeness of the implementation -- Effort you put in -- Impact of the idea +## Screenshots -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 +Nothing says a lot than screenshots. +## Dependencies -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. +Any dependencies required by the project. -Regards, -Vikas +## 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 b + + +## Contribution SetUp + +If people would like to contribute, what steps should they take. + +Overview here and a link to the `CONTRIBUTION.md` file with more details + + +## Code of Conduct + +Overview of Code of Conduct, with link to `CODE_OF_CONDUCT.MD` + + +## Change log / Release history + +Major version & breaking changes + + +## Meta data + +Any other useful information. From 58518f1195e0e24d89351833321840abb415a05f Mon Sep 17 00:00:00 2001 From: srinivas <74464272+srinivas9110322@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:02:28 +0530 Subject: [PATCH 3/5] Update hack.py --- hack.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack.py b/hack.py index f4c9336..759a105 100644 --- a/hack.py +++ b/hack.py @@ -20,21 +20,21 @@ 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("Srinivasa.Bhargava@iiitb.org") +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("Z-G%855h=iDEGXe") +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() -manda = 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') +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(manda).click().perform() +action.move_to_element(da).click().perform() time.sleep(2) pyautogui.click(x,y) From 5d50f9b898f71ace6477c4aa1a8b8b0d1521688f Mon Sep 17 00:00:00 2001 From: srinivas <74464272+srinivas9110322@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:27:43 +0530 Subject: [PATCH 4/5] Update README.md --- README.md | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 555ebae..ece2780 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,3 @@ -$ python3 -m pip install pyautogui# Onedrive Uploader Python Script - -Include any project badges (e.g. CI) here at the top. - -Description of project & its goals. - -The code is incomplete as ## Screenshots @@ -12,38 +5,26 @@ Nothing says a lot than screenshots. ## Dependencies -Any dependencies required by the project. +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``` + 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 b - - -## Contribution SetUp - -If people would like to contribute, what steps should they take. +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.) -Overview here and a link to the `CONTRIBUTION.md` file with more details +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. -## Code of Conduct +At the very least,the code can be used as very simple password manager which autlogin's you to your accounts whith small modifications. -Overview of Code of Conduct, with link to `CODE_OF_CONDUCT.MD` - - -## Change log / Release history - -Major version & breaking changes - - -## Meta data +## Contribution SetUp -Any other useful information. +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). From 89cd98cbfddff11d15e8b6e0c233e814c87bf6a8 Mon Sep 17 00:00:00 2001 From: srinivas <74464272+srinivas9110322@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:41:12 +0530 Subject: [PATCH 5/5] Update and rename README.md to project-details.md --- README.md => project-details.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename README.md => project-details.md (91%) diff --git a/README.md b/project-details.md similarity index 91% rename from README.md rename to project-details.md index ece2780..316d702 100644 --- a/README.md +++ b/project-details.md @@ -1,7 +1,7 @@ -## Screenshots +## Video -Nothing says a lot than screenshots. +Here's a video for you to watch the accomplishment of my code ------>(https://youtu.be/T9DVo9yyNSI) (the video is unlisted). ## Dependencies