Code Monkey home page Code Monkey logo

score-search's Introduction

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

score-search's People

Contributors

tylerjenningsw avatar michaellillis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.