Baseball Discord bot that can post up-to-date scores, lineups, and home runs.

Overview

Sunny Day Discord Bot

Baseball Discord bot that can post up-to-date scores, lineups, and home runs. Uses webscraping techniques to scrape baseball data from various websites in real time to respond to commands.

Overview

This bot has three primary functionalities: retrieving scores, lineups, and home runs.

Scores

To retrieve all scores for the current day, use the command >scores. This will post an image for each matchup today. Scores Example

To retrieve the score for a single team for the current day, use the command >score {team's 3-letter abbreviation}. This will post a single image of that team's matchup, if they have a matchup for today.

Lineups

To retrieve all lineups for the current day, use the command >lineups. This will post an image for each matchup's lineups today. Lineups Example

To retrieve the lineup for a single team for the current day, use the command >lineup {team's 3-letter abbreviation}. This will post a single image of that team's lineup, if they have a game for today. Lineup Example

Home Runs

Between 11am and midnight CT, every 15 minutes this bot will scrape the five most recent home runs, compare these against previous home runs, and post new home runs that have occurred. Home Run Example

Setup

Several steps should be taken prior to activating this bot to ensure your system will be able to run it without error.

OS Compatibility

This bot was designed to work on a Linux server and therefore has some features that are only compatible with Linux. With several changes (removing the daemonization process), the program can be altered to work on Windows or Mac.

Web Browser Availability

This bot uses Selenium to scrape data from the internet. Selenium uses a webdriver to utlize a system's existing web browser to simulate a user accessing the website. The bot is designed to work with a Chrome based browser (Chrome, Chromium, Vivaldi, etc.), but can be altered to work with Firefox, Safari, or Opera.

To use a different browser, make the necessary changes in baseball_spider.py's _prep_driver() function. Otherwise, ensure that a chrome-based browser is downloaded to its default location (/usr/bin/chromium-browser for Chromium on Ubuntu).

.env

You will need to create a .env file in your working directory. This file needs to contain four things:

  • DISCORD_TOKEN={The token for your bot}
  • DISCORD_GUILD={The name of the guild your bot will be hosted on}
  • DISCORD_TARGET_CHANNEL={The channel ID you want the bot to post scheduled updates}
  • DISCORD_NOTIFICATION_CHANNEL={The channel ID where the bot should notify that updates have occurred}

requirements.txt

Be sure to install all libraries in requirements.txt via pip install -r requirements.txt

Running the Bot

To run the bot simply type python bot.py while in the working directory of this project. If all the steps were properly followed in the setup section, you should see the bot connect to the webdriver and then begin waiting.

Logs

Log files are generated for this bot and stored in the logs folder. They will log every action the bot performs, every error that occurs, and the time these events took place.

A new log file is generated for each time the bot is spun up. An example of a log can be found here

Owner
Benjamin Hammack
Data Scientist at Nielsen; MS in Data Science (bioinformatics concentration); BS in Computer Science.
Benjamin Hammack
Checks for a 200 response from your subdomain list.

Check for available subdomains Written in Python, this terminal based application looks for a 200 response from the subdomain list you've provided. En

Sean 1 Nov 03, 2021
AutoExploitSwagger is an automated API security testing exploit tool that can be combined with xray, BurpSuite and other scanners.

AutoExploitSwagger is an automated API security testing exploit tool that can be combined with xray, BurpSuite and other scanners.

6 Jan 28, 2022
Web testing library for Robot Framework

SeleniumLibrary Contents Introduction Keyword Documentation Installation Browser drivers Usage Extending SeleniumLibrary Community Versions History In

Robot Framework 1.2k Jan 03, 2023
Sixpack is a language-agnostic a/b-testing framework

Sixpack Sixpack is a framework to enable A/B testing across multiple programming languages. It does this by exposing a simple API for client libraries

1.7k Dec 24, 2022
Aplikasi otomasi klik di situs popcat.click menggunakan Python dan Selenium

popthe-popcat Aplikasi Otomasi Klik di situs popcat.click. aplikasi ini akan secara otomatis melakukan click pada kucing viral itu, sehingga anda tida

cndrw_ 2 Oct 07, 2022
Python version of the Playwright testing and automation library.

🎭 Playwright for Python Docs | API Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright del

Microsoft 7.8k Jan 02, 2023
Implement unittest, removing all global variable and returning values

Implement unittest, removing all global variable and returning values

Placide 1 Nov 01, 2021
pytest splinter and selenium integration for anyone interested in browser interaction in tests

Splinter plugin for the pytest runner Install pytest-splinter pip install pytest-splinter Features The plugin provides a set of fixtures to use splin

pytest-dev 238 Nov 14, 2022
Avocado is a set of tools and libraries to help with automated testing.

Welcome to Avocado Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native test

Ana Guerrero Lopez 1 Nov 19, 2021
A wrapper for webdriver that is a jumping off point for web automation.

Webdriver Automation Plus ===================================== Description: Tests the user can save messages then find them in search and Saved items

1 Nov 08, 2021
Python Webscraping using Selenium

Web Scraping with Python and Selenium The code shows how to do web scraping using Python and Selenium. We use as data the https://sbot.org.br/localize

Luís Miguel Massih Pereira 1 Dec 01, 2021
Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.

WebTest This wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server. This provides

Pylons Project 325 Dec 30, 2022
a plugin for py.test that changes the default look and feel of py.test (e.g. progressbar, show tests that fail instantly)

pytest-sugar pytest-sugar is a plugin for pytest that shows failures and errors instantly and shows a progress bar. Requirements You will need the fol

Teemu 963 Dec 28, 2022
Yet another python home automation project. Because a smart light is more than just on or off

Automate home Yet another home automation project because a smart light is more than just on or off. Overview When talking about home automation there

Maja Massarini 62 Oct 10, 2022
Enabling easy statistical significance testing for deep neural networks.

deep-significance: Easy and Better Significance Testing for Deep Neural Networks Contents ⁉️ Why 📥 Installation 🔖 Examples Intermezzo: Almost Stocha

Dennis Ulmer 270 Dec 20, 2022
Python selenium script to bypass simaster.ugm.ac.id weak captcha.

Python selenium script to bypass simaster.ugm.ac.id weak "captcha".

Hafidh R K 1 Feb 01, 2022
A library to make concurrent selenium tests that automatically download and setup webdrivers

AutoParaSelenium A library to make parallel selenium tests that automatically download and setup webdrivers Usage Installation pip install autoparasel

Ronak Badhe 8 Mar 13, 2022
WomboAI Art Generator

WomboAI Art Generator Automate AI art generation using wombot.art. Also integrated into SnailBot for you to try out. Setup Install Python Go to the py

nbee 7 Dec 03, 2022
Doggo Browser

Doggo Browser Quick Start $ python3 -m venv ./venv/ $ source ./venv/bin/activate $ pip3 install -r requirements.txt $ ./sobaki.py References Heavily I

Alexey Kutepov 9 Dec 12, 2022
Percy visual testing for Python Selenium

percy-selenium-python Percy visual testing for Python Selenium. Installation npm install @percy/cli: $ npm install --save-dev @percy/cli pip install P

Percy 9 Mar 24, 2022