Code Monkey home page Code Monkey logo

twright-28 / nhl_twitterbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.89 MB

This repository houses a Python bot that leverages the undocumented NHL API to analyze and process data for NHL games. Using Pandas and Matplotlib, it generates insightful analytical plots, which are automatically posted on Twitter via the Twitter API.

Home Page: https://twitter.com/NHLReportCards

Python 100.00%
matplotlib nhl-api pandas-python python twitter-api

nhl_twitterbot's Introduction

NHL Game Data Analysis Twitter Bot

Overview

This Python bot is designed to analyze NHL game data, sourced from the undocumented NHL API, and generate analytical plots using Pandas and Matplotlib. The bot then automatically exports and posts these visualizations on Twitter using the Twitter API. This README provides an overview of the bot's functionality, usage instructions, and prerequisites.

Table of Contents

Features

  • Fetches NHL game data from the undocumented NHL API.
  • Analyzes and processes the data using Pandas.
  • Generates various analytical plots using Matplotlib.
  • Automatically posts the plots on Twitter using the Twitter API.

Installation

  1. Clone the repository:

    git clone https://github.com/TWright-28/NHL_TwitterBot.git
  2. Change to the project directory:

    cd NHL_TwitterBot
  3. Install the required Python dependencies:

    pip install -r requirements.txt

Usage

  1. Set up your Twitter Developer account and obtain API keys and access tokens.

  2. Configure the bot with your Twitter API credentials (see Configuration).

  3. Run the bot:

    python main.py

    The bot will fetch NHL game data, process it, create analytical plots, and post them on your Twitter account.

Configuration

Before running the bot, you need to configure it by providing your Twitter API credentials. Create a keys.py file in the project directory and add the following information:

[Twitter]
consumer_key = your_consumer_key
consumer_secret = your_consumer_secret
access_token = your_access_token
access_token_secret = your_access_token_secret
bearer_token  = your_bearer_token

Replace your_consumer_key, your_consumer_secret, your_access_token, and your_access_token_secret with your actual Twitter API credentials.

Dependencies

The bot relies on the following Python libraries:

  • Pandas
  • Matplotlib
  • Requests
  • Numpy
  • Tweepy (for Twitter integration)

You can install these dependencies using the requirements.txt file, as mentioned in the Installation section.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Happy NHL data analysis and Twitter posting!.

nhl_twitterbot's People

Contributors

twright-28 avatar

Watchers

 avatar  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.