{"id":19442942,"url":"https://github.com/syncom/twitbot-iwpt","last_synced_at":"2025-04-25T00:32:08.206Z","repository":{"id":44566805,"uuid":"103369561","full_name":"syncom/twitbot-iwpt","owner":"syncom","description":"Twitter bot that tweets about the primality of today's date in ISO 8601 format","archived":false,"fork":false,"pushed_at":"2025-04-19T21:45:04.000Z","size":1269,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T22:55:12.878Z","etag":null,"topics":["prime-days","prime-factorizations","prime-numbers","twitter-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syncom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-09-13T07:43:40.000Z","updated_at":"2025-04-19T21:45:06.000Z","dependencies_parsed_at":"2024-12-20T14:38:11.258Z","dependency_job_id":"8c169820-15ab-48de-9127-c9cc3c8d7d78","html_url":"https://github.com/syncom/twitbot-iwpt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Ftwitbot-iwpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Ftwitbot-iwpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Ftwitbot-iwpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Ftwitbot-iwpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syncom","download_url":"https://codeload.github.com/syncom/twitbot-iwpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250733324,"owners_count":21478339,"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":["prime-days","prime-factorizations","prime-numbers","twitter-bot"],"created_at":"2024-11-10T15:41:30.556Z","updated_at":"2025-04-25T00:32:06.992Z","avatar_url":"https://github.com/syncom.png","language":"Python","readme":"# twitbot-iwpt: Is What Prime Today?\n\n[![Sanity checks](https://github.com/syncom/twitbot-iwpt/actions/workflows/sanity.yml/badge.svg)](https://github.com/syncom/twitbot-iwpt/actions/workflows/sanity.yml)\n\nA Twitter bot that tweets, if the current date in ISO 8601 format, without the\nhyphens (e.g., 20170913), is a prime number. For example, on September 1,\n2017, it would tweet\n\n```text\nToday 20170901 is a prime\na Chen prime\nan Eisenstein prime\na Pythagorean prime\nhas a twin prime\nhas a cousin prime.\n```\n\nIf the current date is not a prime number, it will tweet the factorization\nof the ISO-8601-formatted date. For example,\n\n```text\nToday 20180503 is not a prime\n20180503 = 7^2 x 37 x 11131\n```\n\n## Dependencies\n\n- Python 3.6 or above\n- Unix/Linux environment with the 'date' command and the [Pari/GP\n  calculator](http://pari.math.u-bordeaux.fr/). On Ubuntu, `apt install pari-gp`\n  will get Pari/GP installed.\n- The ['prime_classes' project](https://github.com/syncom/prime_classes) on\n  Github.\n\n## Usage\n\nSimilar to that described in \u003chttps://github.com/syncom/twitbot-tih\u003e.\n\n1. Create a Twitter app and obtain the API Key, API Secret, Access Token, and\n   Access Token Secret for the app. This can be done by following the\n   instructions at:\n   \u003chttps://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api\u003e.\n   On 20230429, we started to see API authentication errors, and a message \"This\n   app has violated Twitter rules and policies\" on the Twitter app setting page.\n   According to [this\n   discussion](https://twittercommunity.com/t/this-app-has-violated-twitter-rules-and-policies/191204/10),\n   we signed up for the Free tier of \"[Twitter API\n   v2](https://developer.twitter.com/en/portal/products)\" (at no cost), and\n   clicked button \"downgrade to free\"; this resolved the auth issue. You may\n   also need to put the Twitter app under a \"project\" for better organization\n   and monitoring of the app.\n\n1. Clone this repository with the submodule and change directory to it. Set up\n   Python3 virtual environment.\n\n   ```bash\n   git clone --recursive https://github.com/syncom/twitbot-iwpt.git\n   cd twitbot-iwpt\n   # Set up virtualenv and pip install packages\n   make install\n   ```\n\n1. Set up authentication and authorization secrets by following [this Getting\n   Started\n   guide](https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api).\n   The preferred way is to set environment variables `IWPT_API_KEY`,\n   `IWPT_API_SECRET`, `IWPT_ACCESS_TOKEN`, and `IWPT_ACCESS_SECRET` with API\n   Key, API Secret, Access Token, and Access Token Secret values obtained in the\n   first step. Alternatively, one can override the corresponding strings in the\n   file '.auth' with appropriate secret strings.  When any of the aformetioned\n   environment variables are set, they take precedence over values in the\n   `.auth` file.\n\n1. Run `./iwpt_bot_run.sh` to tweet. Note that it only tweets when the ISO 8601\n   formatted string for today's date is a prime number. The log files for each\n   day's tweet can be found in the 'logs' subdirectory. They keep state of the\n   primality info and the tweet status, and are used by our application to make\n   tweeting decisions.\n\n1. (Optional) Create a cron job to invoke the bot multiple times a day, to\n   account for sporadic connecitivity issues.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Ftwitbot-iwpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncom%2Ftwitbot-iwpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Ftwitbot-iwpt/lists"}