/pollevbot

Response bot for multiple-choice polls on PollEverywhere

Primary LanguagePythonMIT LicenseMIT

pollevbot

pollevbot is a bot that automatically responds to polls on pollev.com. It continually checks if a specified host has opened any polls. Once a poll has been opened, it submits a random response.

Requires Python 3.7 or later.

Dependencies

Requests, BeautifulSoup.

APScheduler to deploy to Heroku.

Usage

Install pollevbot:

pip install pollevbot

Set your username, password, and desired poll host:

user = 'My Username'
password = 'My Password'
host = 'PollEverywhere URL Extension e.g. "uwpsych"'

And run the script.

from pollevbot import PollBot

user = 'My Username'
password = 'My Password'
host = 'PollEverywhere URL Extension e.g. "uwpsych"'

# If you're using a non-UW PollEv account,
# add the argument "login_type='pollev'"
with PollBot(user, password, host) as bot:
    bot.run()

Alternatively, you can clone this repo, set your login credentials in main.py and run it from there.

Heroku

pollevbot can be scheduled to run at specific dates/times (UTC timezone) using Heroku:

Deploy

Required configuration variables:

  • DAY_OF_WEEK: cron string specifying weekdays to run pollevbot (e.g. mon,wed is Monday and Wednesday).
  • HOUR: cron string (UTC time) specifying which hours to run pollevbot.
  • LIFETIME: Time to run pollevbot before terminating (in seconds). Set to inf to run forever.
  • LOGIN_TYPE: Login protocol to use (either uw or pollev).
  • MINUTE: cron string specifying what minutes to run pollevbot.
  • PASSWORD: PollEv account password.
  • POLLHOST: PollEv host name.
  • USERNAME: PollEv account username.

Example

Suppose you want to answer polls made by poll host teacher123 every Monday and Wednesday from 11:30 AM to 12:30 PM PST (6:30 PM to 7:30 PM UTC) in your timezone on your UW account. To do this, set the config variables as follows:

  • DAY_OF_WEEK: mon,wed
  • HOUR: 18
  • LIFETIME: 3600
  • LOGIN_TYPE: uw
  • MINUTE: 30
  • PASSWORD: yourpassword
  • POLLHOST: teacher123
  • USERNAME: yourusername

Then click Deploy App and wait for the app to finish building. pollevbot is now deployed to Heroku!

Disclaimer

I do not promote or condone the usage of this script for any kind of academic misconduct or dishonesty. I wrote this script for the sole purpose of educating myself on cybersecurity and web protocol automation, and cannot be held liable for any indirect, incidental, consequential, special, or exemplary damages arising out of or in connection with the usage of this script.