Bot to send new comments to channel in Slack
Project description
TW Comments
A CLI tool to get comments from Youtube and repost them in a Slack channel.
Installation
pip3 install tw-comments
Usage
You need three things to use this tool:
- A Youtube API key
- A Youtube playlist ID
- A Slack webhook URL
Youtube API key
You can get a Youtube API key by following the instructions here.
Youtube playlist ID
You can get a Youtube playlist ID by following the instructions here.
Slack webhook URL
You can get a Slack webhook URL by following the instructions here.
Run the tool
This is a example of how to run the tool to get the comments of all videos and repost them in a Slack channel:
tw-comments youtube --send-to=slack --youtube-api-key=your-youtube-api-key --youtube-playlist-id=your-youtube-playlist-id --slack-webhook-url=your-slack-webhook-url
You can also run the tool to send the comments to the standard output, in the case you don't need to pass the --slack-webhook-url
argument:
tw-comments youtube --send-to=stdout --youtube-api-key=your-youtube-api-key --youtube-playlist-id=your-youtube-playlist-id
The tool will create a file called last_execution.txt
in the current directory. This file will be used to get the last execution date and time. This way, the tool will only get the comments of the videos that were uploaded after the last execution. If you want to change the path of this file, you can use the --last-execution-filename
argument:
tw-comments youtube --send-to=slack --youtube-api-key=your-youtube-api-key --youtube-playlist-id=your-youtube-playlist-id --slack-webhook-url=your-slack-webhook-url --last-execution-filename=/path/to/last_execution.txt
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tw_comments-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea05b5b3e42accdd8f1e13fad50d1296d8c74d2b4648a3f5fe0ceac6dcd5cb6b |
|
MD5 | 9a3b9386f080bfcde3c7e4860c9f50e5 |
|
BLAKE2b-256 | bc932d3a6cae9b17e41309ec160b94bf482f64fb5b10e932b4df6b5a6548636b |