Skip to main content

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

tw_comments-0.1.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

tw_comments-0.1.0-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page