DEV Community

Cover image for I made a Google classroom bot in less than 100 lines!
Manitej ⚡
Manitej ⚡

Posted on • Edited on

I made a Google classroom bot in less than 100 lines!

Online classes are boring. So I decided to make a bot that attends on my behalf.

Features that I need

  • Join online classes without disturbing me
  • Send a message in the chatbox if someone calls me
  • Doesn't want my sleep to be spoiled

So, I Made a script. Now I don't want to write a long tutorial on how I did and all those stuff. Instead, I'll tell you how to use the script.

Technologies used

  • Python
  • Selenium
  • PyAutoGUI

GitHub Repo

Give it a ⭐ if you like my work

GitHub logo Manitej66 / google-classroom-automation

This is a Python automation script that attends online classes (Google classroom) on your behalf

💻 google-classroom-automation

This is a Python automation script that attends online classes (Google classroom) on your behalf 😉

👀 Features

  • Automatic joining in all classes from timetable in single click
  • Custom timetable support
  • Sends message if a specific keyword is called
  • Custom keyword support

🤖 Requirements

  • PyAutoGUI
  • selenium

❓ How to run the script :

  1. Clone the repo

  2. Open terminal in folder and run the below code

    pip install -r requirements.txt
    Enter fullscreen mode Exit fullscreen mode
  3. Go to Chrome driver download and download the driver specific to your chrome version

  4. Extract the zip in C:\Program Files (x86) directory

  5. Go to today_classes.py and replace alertWords , classes and subjects with your time table

  6. Go to today_classes.py line 81 and enter your email

  7. Go to today_classes.py line 88 and enter your email password

  8. That's it. There are 3 options in the script

    • get today periods
    class -t
    Enter fullscreen mode Exit fullscreen mode
    • join a specific period
    class -
    Enter fullscreen mode Exit fullscreen mode

Video tutorial

How to run the script :

  1. Clone the repo
  2. Open terminal in folder and run the below code
   pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode
  1. Go to Chrome driver download and download the driver specific to your chrome version

  2. Extract the zip in C:\Program Files (x86) directory

  3. Go to today_classes.py and replace alertWords , classes and subjects with your time table

alertWords : The words for which the script need to send a message (To customize the message go to line 126)

subjects : Dictionary of timetable.

classes : Google meet links for all subjects


# WHEN THESE WORDS ARE TRIGGERED A MESSAGE WILL BE SENT
alertWords = [ "your_name", "are you there", "unmute yourself", "say something", "can you hear me"]

# TIME TABLE HERE
subjects = {'monday' : ['UNIX', 'OOAD', 'CD', 'OS', 'DBMS'],
                'wednesday' : ['CD', 'OOAD', 'OS','DBMS', 'OS'],
                'friday' : ['OOAD', 'PEHV', 'CD',  'OS', 'UNIX'],
              }

# GOOGLE MEET LINKS TO RESPECTIVE SUBJECTS
classes = { 'UNIX': 'https://meet.google.com/lookup/e3667sh3xh',
                'CD':'link_to_sub',
                'PEHV':'link_to_sub',
                'OS':'link_to_sub',
                'OOAD':'link_to_sub',
                'DBMS':'link_to_sub'
          }
Enter fullscreen mode Exit fullscreen mode
  1. Go to today_classes.py line 81 and enter your email

  2. Go to today_classes.py line 88 and enter your email password

  3. That's it. There are 3 options in the script

  • get today periods

Returns list of periods today

   class -t
Enter fullscreen mode Exit fullscreen mode
  • join a specific period

Opens an automated chrome browser and joins that specific subject class automatically

   class subject_name
Enter fullscreen mode Exit fullscreen mode
  • automate today classes

Opens an automated chrome browser and joins all periods on the specific date automatically

   class -a
Enter fullscreen mode Exit fullscreen mode

The above command will run throughout the day and exit after the last class.

That's it, folks. Do let me know if you want a tutorial on how-to!

Top comments (1)

Collapse
 
jibinp profile image
Jibin Philipose

Nice automation 🤣🤣🤣. I would definitely like a how to on this.