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
Test python asyncio-based code with ease.

aiounittest Info The aiounittest is a helper library to ease of your pain (and boilerplate), when writing a test of the asynchronous code (asyncio). Y

Krzysztof Warunek 55 Oct 30, 2022
Photostudio是一款能进行自动化检测网页存活并实时给网页拍照的工具,通过调用Fofa/Zoomeye/360qua/shodan等 Api快速准确查询资产并进行网页截图,从而实施进一步的信息筛查。

Photostudio-红队快速爬取网页快照工具 一、简介: 正如其名:这是一款能进行自动化检测,实时给网页拍照的工具 信息收集要求所收集到的信息要真实可靠。 当然,这个原则是信息收集工作的最基本的要求。为达到这样的要求,信息收集者就必须对收集到的信息反复核实,不断检验,力求把误差减少到最低限度。我

s7ck Team 41 Dec 11, 2022
A simple script to login into twitter using Selenium in python.

Quick Talk A simple script to login into twitter using Selenium in python. I was looking for a way to login into twitter using Selenium in python. Sin

Lzy-slh 4 Nov 20, 2022
A suite of benchmarks for CPU and GPU performance of the most popular high-performance libraries for Python :rocket:

A suite of benchmarks for CPU and GPU performance of the most popular high-performance libraries for Python :rocket:

Dion Häfner 255 Jan 04, 2023
HTTP load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom

hey is a tiny program that sends some load to a web application. hey was originally called boom and was influenced from Tarek Ziade's tool at tarekzia

Jaana Dogan 14.9k Jan 07, 2023
splinter - python test framework for web applications

splinter - python tool for testing web applications splinter is an open source tool for testing web applications using Python. It lets you automate br

Cobra Team 2.6k Dec 27, 2022
Network automation lab using nornir, scrapli, and containerlab with Arista EOS

nornir-scrapli-eos-lab Network automation lab using nornir, scrapli, and containerlab with Arista EOS. Objectives Deploy base configs to 4xArista devi

Vireak Ouk 13 Jul 07, 2022
pywinauto is a set of python modules to automate the Microsoft Windows GUI

pywinauto is a set of python modules to automate the Microsoft Windows GUI. At its simplest it allows you to send mouse and keyboard actions to windows dialogs and controls, but it has support for mo

3.8k Jan 06, 2023
Headless chrome/chromium automation library (unofficial port of puppeteer)

Pyppeteer Pyppeteer has moved to pyppeteer/pyppeteer Unofficial Python port of puppeteer JavaScript (headless) chrome/chromium browser automation libr

miyakogi 3.5k Dec 30, 2022
The Penetration Testers Framework (PTF) is a way for modular support for up-to-date tools.

The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux based distributions to create a similar and familiar distribution for Penetration Testing

trustedsec 4.5k Dec 28, 2022
A simple asynchronous TCP/IP Connect Port Scanner in Python 3

Python 3 Asynchronous TCP/IP Connect Port Scanner A simple pure-Python TCP Connect port scanner. This application leverages the use of Python's Standa

70 Jan 03, 2023
CNE-OVS-SIT - OVS System Integration Test Suite

CNE-OVS-SIT - OVS System Integration Test Suite Introduction User guide Discussion Introduction CNE-OVS-SIT is a test suite for OVS end-to-end functio

4 Jan 09, 2022
Local continuous test runner with pytest and watchdog.

pytest-watch -- Continuous pytest runner pytest-watch a zero-config CLI tool that runs pytest, and re-runs it when a file in your project changes. It

Joe Esposito 675 Dec 23, 2022
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
Show surprise when tests are passing

pytest-pikachu pytest-pikachu prints ascii art of Surprised Pikachu when all tests pass. Installation $ pip install pytest-pikachu Usage Pass the --p

Charlie Hornsby 13 Apr 15, 2022
It helps to use fixtures in pytest.mark.parametrize

pytest-lazy-fixture Use your fixtures in @pytest.mark.parametrize. Installation pip install pytest-lazy-fixture Usage import pytest @pytest.fixture(p

Marsel Zaripov 299 Dec 24, 2022
A Modular Penetration Testing Framework

fsociety A Modular Penetration Testing Framework Install pip install fsociety Update pip install --upgrade fsociety Usage usage: fsociety [-h] [-i] [-

fsociety-team 802 Dec 31, 2022
Redis fixtures and fixture factories for Pytest.

Redis fixtures and fixture factories for Pytest.This is a pytest plugin, that enables you to test your code that relies on a running Redis database. It allows you to specify additional fixtures for R

Clearcode 86 Dec 23, 2022
Obsei is a low code AI powered automation tool.

Obsei is a low code AI powered automation tool. It can be used in various business flows like social listening, AI based alerting, brand image analysis, comparative study and more .

Obsei 782 Dec 31, 2022
Let your Python tests travel through time

FreezeGun: Let your Python tests travel through time FreezeGun is a library that allows your Python tests to travel through time by mocking the dateti

Steve Pulec 3.5k Dec 29, 2022