Skip to content

Score Search is a Discord bot and web scraper that allows you to search Google and ESPN for sports scores that you and your friends can all see from a single screenshot without leaving Discord!

Notifications You must be signed in to change notification settings

michaellillis/score-search

Repository files navigation

Score Search

Score Search is a Discord Bot created by @TylerJenningsW and @MichaelLillis using TypeScript, Puppeteer for web scraping, and Discord.JS as a Discord API wrapper.

NOTE: This project is meant to be a learning experience, as both authors had limited knowledge of TypeScript and Puppeteer going into the project.

General Information ℹ️

The Score Search Discord bot allows you and your friends to look at live or past sports scores. By using the commands given below, the bot automatically goes to the chosen site (ESPN or Google), searches the game or team you've chosen, and screenshots the game and stats for the whole discord to see. The perfect tool for trash talking on a Football Sunday ;)

Installation 💻

Run the following commands in terminal/command prompt:

yarn install

Configuration ⚙️

• Insert your discord bot token and your server id into the .env

yarn build
yarn start

Deploy to Heroku 🚀

• Fork this repo to your github
• Create a new app on heroku
• Under Resources enable the yarn start worker, and disable web
• Under Settings reveal config vars, then insert your token, application id, and guild id.
• Then, set your buildpacks to the following:

heroku/nodejs
jontewks/puppeteer

• Under deploy connect your Github account and connect the repo
• Enable automatic deploys

Commands 📝

Find a game/team on ESPN you'd like a score update on (best for advanced statistics):

/Score espn [team name(s)]

Find a game/team on Google you'd like a score update on (best for quick score overview):

/Score google [team name(s)]

How it Works 💡

• The scraper searches on Google with the input you give it, attempts to find the box score of the given game, and takes a screenshot to post back to the Discord channel.
• Since our web scraper searches through Google, you can make the Search as specific as you'd like it to be!
• If your search fails with the site you've chosen (ESPN or Google), it will attempt the search on the opposing site as well.
• We adjusted the CSS before the screenshot takes place to allow for clear and relevant information/statistics to display.
• Speeds can range from 3-5 seconds (command to bot response)!

Screenshots/Examples 📷

'/score google [phillies]' - As an example of wanting to see a live/most recent game the Phillies played!

0U2ztME

/score google [eagles vs cowboys 2017] - As an example of wanting to see all games the Eagles/Cowboys played against each other in 2017!

TOk5bNh

/score espn [broncos] - As an example of wanting to see a more detailed view of a game (better for box score stats)!

XVX6ZOt

Screenshot when clicked in Discord:

vhN3L0T

Links 🔗

Discord.JS - Discord API

Puppeteer - Web API

Discord - VoIP and instant messaging platform

TypeScript

Node.JS

Google

ESPN

About

Score Search is a Discord bot and web scraper that allows you to search Google and ESPN for sports scores that you and your friends can all see from a single screenshot without leaving Discord!

Topics

Resources

Stars

Watchers

Forks

Languages