Giter VIP home page Giter VIP logo

lemmy_nba_gameday_bot's Introduction

Lemmy NBA Gameday Bot

GitHub license

A Lemmy Bot that create and maintains NBA Game threads, Post Game threads and Daily Game Index threads.

The Bot uses

  • nba_api - An API Client package to access the APIs for NBA.com
  • pythorhead - A python library for interacting with Lemmy

DISCLAIMER: THIS CODE IS STILL IN DEVELOPMENT, USE AT YOUR OWN RISK!

How does it work

Running the Bot

Parameters

The following parameters are needed for the bot to run:

  • domain (or environment var INSTANCE_URL): Base endpoint to the Lemmy instance, for example 'https://lemmy.world' (note - https, and no '/' at the end)
  • username (or environment var BOT_USERNAME):The Bot's username
  • password (or environment var BOT_PASSWORD):The Bot's password
  • community (or environment var BOT_COMMUNITY): Lemmy community name, so this is the full community URL {domain}/c/{community}
  • admin_id (or environment var BOT_ADMIN_ID): A Lemmy User ID, that will receive a Direct Message from the BOT when it's failed in unexpected ways... A hacky way to find this ID is by trying to DM the user, and looking at the URL which would be in the shape of https://lemmy.world/create_private_message/

The following parameters are optional:

  • sleep (or environment var BOT_SLEEP_SECS): Sleep duration between Bot cycles, defaults to 60 seconds
  • team_name (or environment var BOT_TEAM_NAME): A team abbreviation (e.g. BOS) or full name (Boston Celtics). If set, the Bot will only create posts for this specific team, and will not create Daily Index posts (as they will only have a single line)

Download and run

git clone https://github.com/GitBarns/lemmy_nba_gameday_bot.git
cd lemmy_nba_gameday_bot
python3 ./nbagamebot.py --domain 'https://lemmy.world' --username '<Bot User name or Email>' --password '<Bot Password>' --community 'nba' --admin_id <LEMMY USER ID>

Logs would be created in the Logs folder

Note: This above is for testing purposes. You will need to run the Bot as a background process, using nohup or tmux or byobu or something similar

Bugs

Encounter a bug, report a bug.

FAQ

How do I get a Lemmy Bot account?

Creating a Bot is identical to creating a user on your Lemmy Instance but please make sure you mark your Bot as such in its settings page

Optionally: Make the Bot a Mod if Daily Index Posts are needed so it can Feature these posts (pin them to the top of the community)

I got the code, now what?

Well, you will need to self-host the bot. There are quite a few free options for hosting a small python project such as this. One potential solution is to open a Google Cloud Account and use their free tier compute instance, which should be enough,

How can I contribute?

Want to contribute? Make a pull request. Contact @GitBarns with any questions.

What about MLB, NFL, MLS, or any other league?

Any league where a stable python API client exist should be possible but most likely not as part of this library. Please feel free to fork and create your own versions!

lemmy_nba_gameday_bot's People

Contributors

dependabot[bot] avatar gitbarns avatar

Watchers

 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.