{"id":28805916,"url":"https://github.com/saadmanrafat/twitivity","last_synced_at":"2026-01-11T22:46:47.021Z","repository":{"id":45997577,"uuid":"217999942","full_name":"saadmanrafat/twitivity","owner":"saadmanrafat","description":":snake: Twitter Accounts Activity API Client Library for Python","archived":false,"fork":false,"pushed_at":"2025-05-31T08:55:25.000Z","size":10119,"stargazers_count":57,"open_issues_count":6,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-09T20:03:44.665Z","etag":null,"topics":["callback-url","crc","ngrok","pypi","python","python3","register","twitter","twitter-account-activity","twitter-api","twitter-client","webhook-url","webhooks"],"latest_commit_sha":null,"homepage":"https://twitivity.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saadmanrafat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"custom":["https://paypal.me/saadmanrafat"]}},"created_at":"2019-10-28T08:32:05.000Z","updated_at":"2025-08-18T10:15:27.000Z","dependencies_parsed_at":"2025-06-07T02:53:05.998Z","dependency_job_id":"257a0e53-3ddb-4316-8947-38eebbbb58c2","html_url":"https://github.com/saadmanrafat/twitivity","commit_stats":null,"previous_names":["saadmanrafat/twitivity","twitivity/twitivity"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/saadmanrafat/twitivity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadmanrafat%2Ftwitivity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadmanrafat%2Ftwitivity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadmanrafat%2Ftwitivity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadmanrafat%2Ftwitivity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saadmanrafat","download_url":"https://codeload.github.com/saadmanrafat/twitivity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadmanrafat%2Ftwitivity/sbom","scorecard":{"id":794079,"data":{"date":"2025-08-11","repo":{"name":"github.com/saadmanrafat/twitivity","commit":"f293e3f753a20ce50b572ac10a5e613b323038ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T08:25:21.664Z","repository_id":45997577,"created_at":"2025-08-23T08:25:21.664Z","updated_at":"2025-08-23T08:25:21.664Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["callback-url","crc","ngrok","pypi","python","python3","register","twitter","twitter-account-activity","twitter-api","twitter-client","webhook-url","webhooks"],"created_at":"2025-06-18T10:43:49.053Z","updated_at":"2026-01-11T22:46:47.015Z","avatar_url":"https://github.com/saadmanrafat.png","language":"Python","funding_links":["https://paypal.me/saadmanrafat"],"categories":[],"sub_categories":[],"readme":"# Twitivity\n[![Premium](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fpremium)](https://developer.twitter.com/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/imgur-scraper) [![Downloads](https://pepy.tech/badge/twitivity)](https://pepy.tech/project/twitivity) ![PyPI - License](https://img.shields.io/pypi/l/twitivity)\n\nTwitter [Accounts Activity](https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview) API Client Library for Python. \n\n![](assets/demo.gif)\n\nAccount Activity API allows you to subscribe to user activities. Unlike Twitter's REST API or the Streaming API, the Account Activity API delivers data through webhook connections. Which makes it faster and allows it to deliver Twitter data to you in real-time. [You can subscribe to these user activities](https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview).\n\n## Getting Started\n\n* [Apply for a Twitter Developer Account](https://developer.twitter.com/en/account/get-started)\n* [Create an application](https://developer.twitter.com/en/apps), fill in the required fields, the callback URL is your domain name with an added endpoint, for example `https://yourdomain.com/listener`. Twitter will later use this URL to send you account activity data. Make sure to enable \"Read, Write and Direct messages\" permission.\n* Navigate to the [Dev environment section](https://developer.twitter.com/en/account/environments) and `setup a dev environment` for the Account Activity API. Name a dev environment label of your choosing and select your app.\n\nThe next step is to register your webhook URL. Twitter will send a `GET` request with Challenge-Response Check or CRC token to verify you are the owner of the app and the webhook URL. To validate, an encrypted response token based on your consumer key and the CRC token has to be sent back to Twitter. Upon successful validation, registration of the webhook URL and subscription. Twitter will send data to this endpoint (the webhook URL) as a `POST` request.\n\n## Why Twitivity?\n\n`Twitivity` does all the heavy lifting under the hood. All you have to do is to create an app and set up a dev environment. Run the application and concentrate on what's really important — building your app.  \n\n* Performs challenge-response check validation\n* Registers webhook URL.\n* Subscribes to current user's context\n* Receives Twitter Account Activity in real-time\n\n## Usage\n\n[Ngrok](https://ngrok.com/) is a handy tool to try out the API locally, on your machine. Install and run ngrok and replace your app's URL and callback URL with the link ngrok provides. Make sure to use the one with `https`.\n\n```terminal\n~$ ./ngrok http 5000\n```\n### Stream events in real time.\n\n```python3\n# stream_events.py\n\n\u003e\u003e\u003e from twitivity import Event\n\u003e\u003e\u003e import json\n\n\u003e\u003e\u003e class StreamEvent(Event):\n     CALLBACK_URL: str = \"https://yourdomain.com/listener\"\n\n     def on_data(self, data: json) -\u003e None:\n         # process data\n\n\u003e\u003e\u003e stream_events = StreamEvent()\n\u003e\u003e\u003e stream_events.listen()\n```\n\n## Configuration\n\nThe configuration below only has to be done once before running the application for the first time.\n\n\n#### Store the credentials as environment variables.\n\n[`App`](https://developer.twitter.com/en/apps) :arrow_right: `Details` :arrow_right: `Keys and Tokens`\n\n```\n~$ export consumer_key=API_KEY\n~$ export consumer_secret=API_SECRET_KEY\n~$ export access_token=ACCESS_TOKEN\n~$ export access_token_secret=ACCESS_TOKEN_SECRET\n~$ export env_name=ENV_NAME # this is the dev environment label name you choose.\n```\n\n#### Register \u0026 Subscribe\n\nTo register the webhook URL and subscribe to activities, run both programs in **parallel** \n(first `stream_events.py` then `configure.py`). This will register the webhook URL and subscribe to the user's activities.\n\n```python3\n# configure.py\n\u003e\u003e\u003e from twitivity import Activity\n\n\u003e\u003e\u003e account_activity = Activity()\n\u003e\u003e\u003e account_activity.register_webhook(\"https://youdomain.com/listener\")\n\u003e\u003e\u003e account_activity.subscribe()\n\n# Response\n{\n  'id': '1198870971131686912', # webhook id\n  'url': 'https://yourdomain.com/listener',\n  'valid': True,\n  'created_timestamp': '2019-11-25 07:48:08 +0000'\n}\n```\n\n## Installation\n\n```\n~$ pip3 install twitivity\n```\n\n## Deploying\n\n[Documentation](https://repo.twitivity.dev/) on how to deploy it on web servers.\n\n\nSupported Versions: **Python 3.6**, **Python 3.7** and **Python 3.8**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadmanrafat%2Ftwitivity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadmanrafat%2Ftwitivity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadmanrafat%2Ftwitivity/lists"}