Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rikardfahlstrom/floorball-game-monitor

Monitors given floorball games in any of the Swedish leagues and push game updates to given Slack channel, used when the official app did not support push notifications.
https://github.com/rikardfahlstrom/floorball-game-monitor

beautifulsoup4 floorball python slack

Last synced: 6 days ago
JSON representation

Monitors given floorball games in any of the Swedish leagues and push game updates to given Slack channel, used when the official app did not support push notifications.

Awesome Lists containing this project

README

        

# Floorball game monitor
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c82f8b283d9045a681cd4b03c03788ec)](https://www.codacy.com/manual/rikard.fahlstrom/floorball-game-monitor?utm_source=github.com&utm_medium=referral&utm_content=RikardFahlstrom/floorball-game-monitor&utm_campaign=Badge_Grade)

## Overview
Since the official iPhone app for the Swedish Floorball association
do not support push notifications for match events, I created
my own scraping script that checks for changes in specific match result
and sends a push notification to a given Slack channel.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine.

### Prerequisites

What things you need to install the software and how to install them

* Python 3.6 or above
* A Slack app which can post messages to a specific channel based on an incoming webhook

### Installing

Run below to get the necessary libraries, preferably in a virtualenv.

```bash
$ virtualenv -p python3 virtualenv_name
```
```bash
$ source virtualenv_name/bin/activate
```

Then
```bash
$ pip install -r requirements.txt
```

Create the `config.py` in the same directory as `program.py`
It should contain this information:

```python
slack_token = "xxxxxxxxxx"
```

## Usage
To monitor a the result from a specific game from the command line:
```bash
$ python program.py
```

To schedule upcoming games via crontab
```bash
* * * * * python3
```
Where
* `` is found in the URL from a specific game detail view
* `` is start time of the specific game in format `%Y-%m-%d %H:%M`

Specific example with [this game](https://innebandy.se/statistik/sasong/37/serie/11566/match/503033)
* crontab schedule `02 19 03 01 *`
* `` is 503033
* `` is "2020-01-03 19:00"

Ends up with
```bash
02 19 03 01 * python3 "503033" "2020-01-03 19:00"
```

## Contributing

Please open an issue or send a pull request.

## Acknowledgments

* [README-template](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2.js) - The template I used as a starting point