Skip to main content

Contributter Ranking Bot

Project description

contributter-ranking-bot

PyPI Maintainability

Run Bot Release Package pages-build-deployment pre-commit.ci

contributterを使っているユーザーの1日のcontribute数トップ3をメンション付きで自動ツイートするbotです。

  • Original: Twitter Follow
    • → Forked: Twitter Follow

Installation

pip install contributter-ranking-bot
# or:
pip install git+https://github.com/eggplants/contributter-ranking-bot

CLI Usage

$ crb -h
usage: crb [-h] [-k PATH] [-d DAY] [-w SEC] [-n N] [-q] [-V]

This command makes Contributter Ranking Bot easier to run.

optional arguments:
  -h, --help                show this help message and exit
  -k PATH, --key PATH       key file (default: None)
  -d DAY, --day-before DAY  n days before (default: 1)
  -w SEC, --wait-sec SEC    interval of retrieving tweets (default: 10)
  -n N, --top-n N           top n to tweet (default: 3)
  -q, --quiet               suppress log print (default: False)
  -V, --version             show program's version number and exit

$ cat .twitter.key
CONSUMER_KEY="***"
CONSUMER_SECRET="***"
ACCESS_TOKEN="***"
ACCESS_TOKEN_SECRET="***"

$ crb -k .twitter.key
Thu Apr 21 19:26:42 UTC 2022
# Running Bot was successful!
# See at: https://twitter.com/satoch_bot/status/1517223447868448768
{
    "created_at": "Thu Apr 21 19:27:13 +0000 2022",
...
}

$ crb -d 5 -n 5 -k .twitter.key  # 5 days before, tweet top-five ranking

処理機構

  1. 昨日の#contributter_reportのついたツイート内のcontribution数とユーザーIDを取得
  2. contribution数を集計してランキング化
  3. ランキング上位3人をメンションしてcontribution数を記載し、自動ツイート

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

contributter-ranking-bot-0.0.3.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

contributter_ranking_bot-0.0.3-py3-none-any.whl (6.6 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