{"id":17290985,"url":"https://github.com/jchristgit/cmsc","last_synced_at":"2025-07-09T19:33:45.098Z","repository":{"id":97512045,"uuid":"424265458","full_name":"jchristgit/cmsc","owner":"jchristgit","description":"Champion Mains Subscriber Counter","archived":false,"fork":false,"pushed_at":"2023-09-01T07:16:34.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T18:55:14.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchristgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T14:51:35.000Z","updated_at":"2021-11-04T08:46:15.000Z","dependencies_parsed_at":"2024-03-15T08:00:30.494Z","dependency_job_id":null,"html_url":"https://github.com/jchristgit/cmsc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jchristgit/cmsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Fcmsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Fcmsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Fcmsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Fcmsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristgit","download_url":"https://codeload.github.com/jchristgit/cmsc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Fcmsc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502488,"owners_count":23618615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T10:39:34.430Z","updated_at":"2025-07-09T19:33:45.076Z","avatar_url":"https://github.com/jchristgit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Champion Mains Subscriber Counter\n\n### Installation\n\nRequires:\n\n- Python 3.7+ with the `praw` package\n- PostgreSQL with the schema in `schema.sql` (adjust user ownership as necessary)\n- If posting to Reddit is desired, a Reddit user account\n\n### Usage\n\n```\n$ python -m cmsc --help\nusage: cmsc [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--log-format LOG_FORMAT] [--no-update] [--post-to POST_TO] [--dsn DSN]\n            [--reddit-username REDDIT_USERNAME] [--reddit-password REDDIT_PASSWORD] [--reddit-client-id REDDIT_CLIENT_ID]\n            [--reddit-client-secret REDDIT_CLIENT_SECRET] [--reddit-user-agent REDDIT_USER_AGENT] [--contact CONTACT]\n\nChampion Mains Subscriber Counter. Fetches subreddit counts for a configured list of subreddits into the PostgreSQL database and posts\na summary of subscriber counts to reddit. The actions to take are controlled via the CLI flags in the \"actions\" group.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}\n                        At which level to produce logging output. Defaults to INFO.\n  --log-format LOG_FORMAT\n                        Logging format to use. By default, no timestamps are included in the logs, under the assumption that we are\n                        logging to or a similar log ingester which adds its own timestamps. This option can be used to add a timestamp\n                        to the log format.\n\nactions:\n  Controls the behaviour of this run.\n\n  --no-update           Skip the default behaviour of loading subscriber counts from reddit and storing them into PostgreSQL.\n  --post-to POST_TO     Post subscriber counts and differences with the previous month to the given subreddit.\n\nconnections:\n  Connection credentials for backing and upstream services. All options listed here are mandatory.\n\n  --dsn DSN             PostgreSQL DSN to use for connecting to the database. Can be anything that libpq accepts. [$POSTGRES_DSN]\n  --reddit-username REDDIT_USERNAME\n                        Reddit username for the posting bot. [$REDDIT_USERNAME]\n  --reddit-password REDDIT_PASSWORD\n                        Reddit password for the posting bot. [$REDDIT_PASSWORD]\n  --reddit-client-id REDDIT_CLIENT_ID\n                        Reddit OAuth Client ID for the posting bot. [$REDDIT_CLIENT_ID]\n  --reddit-client-secret REDDIT_CLIENT_SECRET\n                        Reddit OAuth Client Secret for the posting bot. [$REDDIT_CLIENT_SECRET]\n  --reddit-user-agent REDDIT_USER_AGENT\n                        The user agent to use for connecting to reddit to. Please see https://github.com/reddit-\n                        archive/reddit/wiki/API for Reddit's guidelines on choosing a user agent. [$REDDIT_USER_AGENT]\n\noutput:\n  Options influencing the bot output to Reddit.\n\n  --contact CONTACT     Who to contact for any issues with the bot's post. Added to the table that is posted to reddit. For example:\n                        `--contact 'joe#0001 on Discord'` will mention the contact method in the resulting output to allow users to\n                        have a place to report issues to. Not passing this flag will not add any hint as to whom to contact.\n                        [$CONTACT]\n```\n\n### Naming\n\nThis project was born for the subreddit subscriber counting done for the\n\"Champion Mains\" community on Reddit, but can be used anywhere.\n\n## License\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option) any\nlater version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\nA copy of the license can be found in [this directory](./LICENSE).\n\n\u003c!-- vim: set textwidth=80 sw=2 ts=2: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristgit%2Fcmsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristgit%2Fcmsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristgit%2Fcmsc/lists"}