Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugovk/lunchbot
Check what's for lunch at local restaurants and post to Slack
https://github.com/hugovk/lunchbot
bot lunch lunchbot slack slackbot
Last synced: 22 days ago
JSON representation
Check what's for lunch at local restaurants and post to Slack
- Host: GitHub
- URL: https://github.com/hugovk/lunchbot
- Owner: hugovk
- Created: 2017-03-11T09:35:19.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T22:35:02.000Z (about 1 month ago)
- Last Synced: 2024-10-08T15:39:51.073Z (30 days ago)
- Topics: bot, lunch, lunchbot, slack, slackbot
- Language: Python
- Size: 113 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lunchbot
[![GitHub Actions status](https://github.com/hugovk/lunchbot/workflows/Test/badge.svg)](https://github.com/hugovk/lunchbot/actions)
[![Python: 3.8+](https://img.shields.io/badge/Python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)Check what's for lunch at local restaurants and post to Slack
## Setup
```bash
python -m pip install --upgrade -r requirements.txt
```To post to Slack, get a [token](https://github.com/juanpabloaj/slacker-cli#tokens) and save it in the `LUNCHBOT_TOKEN` environment variable.
## Usage
```bash
# Just print out but don't post
python lunchbot.py --dry-run# Post to #lunch channel
python lunchbot.py# For testing, post to some username instead of the #lunch channel
python lunchbot.py --user username
```## Cron
For regular posting, you can use something like cron. For example, create /path/to/lunchbot.sh:
```bash
!/bin/bashexport PATH=/usr/local/bin:$PATH
export LUNCHBOT_TOKEN="TODO_ENTER_YOURS"python /path/to/lunchbot.py >> /tmp/lunchbot.log 2>&1
```And then run `crontab -e` and add this to post at 11:30am every workday (days 1-5):
```
30 11 * * 1-5 /path/to/lunchbot.sh
```