Skip to main content

youtube community alarm package

Project description

Youtube Community Alarm (pypi)

  • Python3 interface for scheduling crontab to retrieve YouTube community posts and send notifications
  • Periodically check for new posts, and if any are found, send a notification to macOS.

Installing

install youtube-community-alarm

$ pip install youtube-community-alarm

Using

The default setting is to check for posts made within the last 10 minutes, using the corresponding cron expression */10 * * * *.
Here is the default usage:

>>> from youtubeCommunityAlarm import CrontabRegister

>>> channel_id = "@my_channel_id"
>>> cr = CrontabRegister(channel_id=channel_id)
>>> cr.register_crontab()

If you want to control the crontab settings, you can do so by passing the following arguments:

>>> from youtubeCommunityAlarm import CrontabRegister

>>> channel_id = "@my_channel_id"
# Check for new posts until those posted within the last 30 minutes using a cron expression "30 * * * *"
>>> cr = CrontabRegister(channel_id=channel_id, time_limit_for_checking_in_minutes=30, cron_expression="30 * * * *")
>>> cr.register_crontab()

Checking Crontab

Check if the crontab is registered by running the following command:

crontab -l

# Default
*/10 * * * * /usr/bin/python3 /path/youtube_community_alarm.py --channel_id @my_channel_id >> /path/log.log 2>&1

# Custom
30 * * * * /usr/bin/python3 /path/youtube_community_alarm.py --channel_id @my_channel_id --time_limit_for_checking_in_minutes 30 >> /path/log.log 2>&1

Crontab Error Case

If you encounter errors from the crontab, you can refer to this troubleshooting guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youtube_community_alarm-0.0.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file youtube_community_alarm-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_community_alarm-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 432d3d7fc95c79870132129af905a111bf8a6835b790e0ffa2e6e5a971b6391f
MD5 da0531338641fb0512bc99eea01b516a
BLAKE2b-256 bb9265ff64e57a9602acdbf8b3b3b259409974ac554c7e7d4d468f79c4d3e2f6

See more details on using hashes here.

Supported by

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