From b60fda9c2eff03c729165357fcab98988f3f41d6 Mon Sep 17 00:00:00 2001 From: rahulvansh66 Date: Fri, 29 Oct 2021 01:12:17 +0530 Subject: [PATCH 1/2] added function to join zoom meeting link --- gmeet_joiner/README.md | 27 ---------- gmeet_joiner/main.py | 35 ------------ gmeet_joiner/requirements.txt | 4 -- gmeet_zoom_joiner/README.md | 35 ++++++++++++ gmeet_zoom_joiner/gmeet_zoom_bot.py | 81 ++++++++++++++++++++++++++++ gmeet_zoom_joiner/requirements.txt | 4 ++ gmeet_zoom_joiner/zoom_btn.png | Bin 0 -> 3110 bytes 7 files changed, 120 insertions(+), 66 deletions(-) delete mode 100644 gmeet_joiner/README.md delete mode 100644 gmeet_joiner/main.py delete mode 100644 gmeet_joiner/requirements.txt create mode 100644 gmeet_zoom_joiner/README.md create mode 100644 gmeet_zoom_joiner/gmeet_zoom_bot.py create mode 100644 gmeet_zoom_joiner/requirements.txt create mode 100644 gmeet_zoom_joiner/zoom_btn.png diff --git a/gmeet_joiner/README.md b/gmeet_joiner/README.md deleted file mode 100644 index 4f83b30cd..000000000 --- a/gmeet_joiner/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Google Meet Automation - -This python script will help you to join daily repetitve classses easily. - - -### Getting Started - -- Firstly clone the project to the desired location, and locate it in the terminal. You would have to download the required modules, you can do this by doing: - `pip install -r requirements.txt` or `pip3 install -r requirements.txt` - -- You can now modify the script slightly according to your schedule: - 1) If you are using chrome as you browser please replace the `for i in range(4)` at line 21 to: - `for i in range(5)` - - If you are using safari do not change the script. - - 2) You can now replace the links with your meet links at line 6 and 7. - - 3) You can replace the timings at line 47 and 48 (in military time): - - 4) Lastly you can replace 'command' with 'ctrl' if you are on windows. - -- This script will let you run two meetings that you have on a daily bases. - - -- Please note: The following program supports python3 - diff --git a/gmeet_joiner/main.py b/gmeet_joiner/main.py deleted file mode 100644 index fced7f22b..000000000 --- a/gmeet_joiner/main.py +++ /dev/null @@ -1,35 +0,0 @@ -import time -import webbrowser -import schedule -import pyautogui - - -url1 = "https://meet.google.com" -url2 = "https://www.google.com" - - -def attend_class(url): - webbrowser.open(url1) - time.sleep(3) - print("Joining Class") - time.sleep(2) - pyautogui.hotkey('command', 'd') - print("Turned off camera") - pyautogui.hotkey('command', 'e') - print("Turned off mic") - time.sleep(3) - - for i in range(4): - pyautogui.press('tab') - - time.sleep(3) - pyautogui.press('enter') - - -if __name__ == "__main__": - schedule.every().day.at("16:00").do(attend_class(url1)) - schedule.every().day.at("06:00").do(attend_class(url2)) - - while True: - schedule.run_pending() # check if we need to run anything - time.sleep(10) # wait 10 second before checking again diff --git a/gmeet_joiner/requirements.txt b/gmeet_joiner/requirements.txt deleted file mode 100644 index d8a28a739..000000000 --- a/gmeet_joiner/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -PyAutoGUI==0.9.52 -schedule==0.6.0 - - diff --git a/gmeet_zoom_joiner/README.md b/gmeet_zoom_joiner/README.md new file mode 100644 index 000000000..98593c2a0 --- /dev/null +++ b/gmeet_zoom_joiner/README.md @@ -0,0 +1,35 @@ +# gmeet_zoom_bot.py + +This python script will help you to join daily repetitive classes easily. + +- It'll join google meet or zoom meeting as per given time and link. + +## Setup instructions + + +- Firstly clone the project to the desired location, and locate it in the terminal. You would have to download the required modules, you can do this by doing: + `pip install -r requirements.txt` or `pip3 install -r requirements.txt` + +- You can now modify the script slightly according to your schedule: + 1) If you are using chrome as you browser then, in `gMeet()` function replace the `for i in range(4)` with `for i in range(5)`. ( If you are using safari do not change the script.) + + 2) Now you can assign your links to `url1` and `url2` variables. + + 3) You can replace the timings in main function. + + 4) Lastly you can replace 'command' with 'ctrl' if you are on windows. + +- This script will let you run two meetings that you have on a daily bases, still you can add more if you wish. + +- Please note: The following program supports python3 + +## Detailed explanation of script, if needed + +Below two key modules of this script. + +* `pyautogui` module is used for automation +* `schedule` module is used to schedule meeting + +## Output + +Join meeting as per given time and link diff --git a/gmeet_zoom_joiner/gmeet_zoom_bot.py b/gmeet_zoom_joiner/gmeet_zoom_bot.py new file mode 100644 index 000000000..3d263e5ee --- /dev/null +++ b/gmeet_zoom_joiner/gmeet_zoom_bot.py @@ -0,0 +1,81 @@ +import time +import webbrowser +import schedule +import pyautogui +from PIL import ImageGrab +import pyperclip + + +url1 = "PASTE gmeet link/zoom link/zoom meeting id" +url2 = "PASTE gmeet link/zoom link/zoom meeting id" + + +def gMeet(url): + webbrowser.open(url) + time.sleep(3) + print("Joining Class") + time.sleep(2) + pyautogui.hotkey('command', 'd') + print("Turned off camera") + pyautogui.hotkey('command', 'e') + print("Turned off mic") + time.sleep(3) + + for i in range(4): + pyautogui.press('tab') + + time.sleep(3) + pyautogui.press('enter') + + +def zMeet(url): + #copy link + pyperclip.copy(url) + + time.sleep(0.2) + + pyautogui.press('esc', interval=0.1) + + time.sleep(0.3) + + #open shart + pyautogui.press('win', interval=0.5) + #type zoom + pyautogui.write('zoom') + time.sleep(2) + #press enter + pyautogui.press('enter', interval=0.5) + + time.sleep(8) + + #Click zoom button + x, y = pyautogui.locateCenterOnScreen('zoom_btn.png') + pyautogui.click(x, y) + + pyautogui.press('enter', interval=0.5) + + #paste link + pyautogui.hotkey('ctrl', 'v') + + #use tabs to move to next section + pyautogui.press('tab', interval=0.5) + pyautogui.press('tab', interval=0.5) + pyautogui.press('tab', interval=0.5) + pyautogui.press('enter', interval=0.5) #mute mic + + pyautogui.press('tab', interval=0.5) + pyautogui.press('enter', interval=0.5) #turn off camera + + pyautogui.press('tab', interval=0.5) + pyautogui.press('enter', interval=3) #join zoom link + + +if __name__ == "__main__": + schedule.every().day.at("16:00").do(gMeet(url1) if ( + url1.startswith("https://meet")) else zMeet(url1)) + schedule.every().day.at("06:00").do(gMeet(url2) if ( + url2.startswith("https://meet")) else zMeet(url2)) + + while True: + schedule.run_pending() # check if we need to run anything + time.sleep(10) # wait 10 second before checking again''' diff --git a/gmeet_zoom_joiner/requirements.txt b/gmeet_zoom_joiner/requirements.txt new file mode 100644 index 000000000..d9de1458a --- /dev/null +++ b/gmeet_zoom_joiner/requirements.txt @@ -0,0 +1,4 @@ +Pillow==8.4.0 +PyAutoGUI==0.9.52 +pyperclip==1.8.2 +schedule==1.1.0 \ No newline at end of file diff --git a/gmeet_zoom_joiner/zoom_btn.png b/gmeet_zoom_joiner/zoom_btn.png new file mode 100644 index 0000000000000000000000000000000000000000..af7bab499f0f149d55a10d1c6cad0f97aff4d6f2 GIT binary patch literal 3110 zcmZuzX*d*Y8y&k@EHQRsM8;UMB&BSF>`W7y5QC)6Ya)%UY%@r zTPj(@SN1fBEZO!I`V5pa^45zXm3|P3_*tX0B+_E>(rMQIcV*&g zw`e-n$wPEGgUcQ1js_91PY$n$MJo2_JSo|wB6|e%qRf&-V5*u~KwH9e2NfUcS4B|n z(H+*?+{q3;w5<#(UvSu*Io!*gUR%Ge6()0ba`4cc-&uylU6zDmzhVZDP(q*S_GlEl z*_<7&c@1%&p@Ca(C_2o_3K@Sxr*4(DTilX9*Y~tofw>>07o# zv4MXl7;mSD((VS6(A!PRNU+dg+qsdP2yNCleg7 z&V?cuO&in-KJf93Dk)QL(t-YynV@n>OQfX}=<6qAbk)zKXrcCGVn(K2mBO~$*8u@h zCw2ISkQj`>j4N6}-jP-K{Od{ko3!hm-AiAyF+EH+l$2_dvxyMXw+6JZ+2Pi49vDN0 z3ko4WPI&i3gl+N~xXzCt>15xH-$d)B?p0u9Zx5Z60Ei;5)gFk8!WehXHIqs<5@+ zxmG`@K?-^%w)OKjd{N)TKHF?uzmMy@NHnRWEt9ie9_in1hoNYJmU9~Y%?SLF!3-q| zSsh{zJ6J;eL_W;dYHI$q$8+h%PXhC^s4aPH5B_NT8weXE5hh#W*FvKWwH|uKeh((<7pJTA9;sDRxUNL^PJgVMj2gKUdp?i<=Zuf^%kFa6L<0(( z4Z=vNK|$JPg;z7!b;49d-QZA9g?v6?5y%zZnrt&#gtu?+hmz72dj6?28rc+q+nmoT zcCSbd4Jti__trN3Kqf7hhpavWNng9>F?ZE) z!M3OHDX_(>-HYM%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Uo`yPSld_U$a${6d3wj<4X@Itw1NT$$R#_DQD8#N!9Q-D0}U%kiuG$f9C^&%`qF%!3R#(hoL7=19kt!Rc#R8Nk21qw zV7ucqMJc3;JVW@audsVLPR-N~Rz>my9s5^~C**Svb`(k=?q1-JmRgpR$&sx9v4}t~ z925dd(uD|pv%l?pj4s)cc4&`^zw;?f3{IP$ebg6jYIU_UWvsET(B`P6jh|OsGvp?5 zM#STx#dRtiKGkG{Ui6%J%v9IhZ*kh}B%iHfMQKHEEDp)TKIZ5Xg1cOjAdxX%R!3HS z^C{~=^!36fWh=?jnFm^BikoxBnSsxn;oc`42*S+6V+*|oyR(q&ALvPo(`?JGwf-^R zr)@SuZRBYMS8VS?$vQ8br#TMujM0DF>)tqq<6=}J&NP+Pzo3D?+s_5B{uB*II?wEa l_>o3`T>ei-HU%88-SoVX-_@IP@u=Ga%uQ^J%aGWJ{{o6z#isxO literal 0 HcmV?d00001 From 5ea19dffffea79e8c661bac5aa68408341195849 Mon Sep 17 00:00:00 2001 From: rahulvansh66 Date: Fri, 29 Oct 2021 01:29:13 +0530 Subject: [PATCH 2/2] added function to join zoom meeting link and used lint --- gmeet_zoom_joiner/gmeet_zoom_bot.py | 21 ++++++++++----------- gmeet_zoom_joiner/requirements.txt | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gmeet_zoom_joiner/gmeet_zoom_bot.py b/gmeet_zoom_joiner/gmeet_zoom_bot.py index 3d263e5ee..f81e7036c 100644 --- a/gmeet_zoom_joiner/gmeet_zoom_bot.py +++ b/gmeet_zoom_joiner/gmeet_zoom_bot.py @@ -2,7 +2,6 @@ import webbrowser import schedule import pyautogui -from PIL import ImageGrab import pyperclip @@ -29,7 +28,7 @@ def gMeet(url): def zMeet(url): - #copy link + # copy link pyperclip.copy(url) time.sleep(0.2) @@ -38,36 +37,36 @@ def zMeet(url): time.sleep(0.3) - #open shart + # open shart pyautogui.press('win', interval=0.5) - #type zoom + # type zoom pyautogui.write('zoom') time.sleep(2) - #press enter + # press enter pyautogui.press('enter', interval=0.5) time.sleep(8) - #Click zoom button + # Click zoom button x, y = pyautogui.locateCenterOnScreen('zoom_btn.png') pyautogui.click(x, y) pyautogui.press('enter', interval=0.5) - #paste link + # paste link pyautogui.hotkey('ctrl', 'v') - #use tabs to move to next section + # use tabs to move to next section pyautogui.press('tab', interval=0.5) pyautogui.press('tab', interval=0.5) pyautogui.press('tab', interval=0.5) - pyautogui.press('enter', interval=0.5) #mute mic + pyautogui.press('enter', interval=0.5) # mute mic pyautogui.press('tab', interval=0.5) - pyautogui.press('enter', interval=0.5) #turn off camera + pyautogui.press('enter', interval=0.5) # turn off camera pyautogui.press('tab', interval=0.5) - pyautogui.press('enter', interval=3) #join zoom link + pyautogui.press('enter', interval=3) # join zoom link if __name__ == "__main__": diff --git a/gmeet_zoom_joiner/requirements.txt b/gmeet_zoom_joiner/requirements.txt index d9de1458a..2fc1593a9 100644 --- a/gmeet_zoom_joiner/requirements.txt +++ b/gmeet_zoom_joiner/requirements.txt @@ -1,4 +1,3 @@ -Pillow==8.4.0 PyAutoGUI==0.9.52 pyperclip==1.8.2 schedule==1.1.0 \ No newline at end of file