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.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

tw_comments-0.1.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file tw_comments-0.1.3.tar.gz.

File metadata

  • Download URL: tw_comments-0.1.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.19.0-35-generic

File hashes

Hashes for tw_comments-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b7cb66b5d30eefd8642ad1c20bc3410786e08ddecd2cbc52a166ef0c4d0bf588
MD5 d9eee14237d35d93cb2675b1644fd2c3
BLAKE2b-256 b93b242fc9806b79a103bf1749d63ad0e4836fcb483533785d1a086f877028e8

See more details on using hashes here.

File details

Details for the file tw_comments-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tw_comments-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.19.0-35-generic

File hashes

Hashes for tw_comments-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f3de0c0f9bbff1be14a204ca367e7ebff6891aa2d191bd582ebf74536eb6f9cb
MD5 84876e1832d8b97bf214b2387432a5d4
BLAKE2b-256 5b93a4d802542302b00fb71fee4c05030d9ec2b3c72a116691aecf32bf3208ac

See more details on using hashes here.

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