{"id":19162782,"url":"https://github.com/centre-for-humanities-computing/twitter-posting-stats","last_synced_at":"2026-02-23T09:40:50.009Z","repository":{"id":206970033,"uuid":"716506101","full_name":"centre-for-humanities-computing/twitter-posting-stats","owner":"centre-for-humanities-computing","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-01T11:58:07.000Z","size":256,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T23:59:23.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/centre-for-humanities-computing.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":"2023-11-09T09:31:39.000Z","updated_at":"2025-01-23T13:51:06.000Z","dependencies_parsed_at":"2023-11-13T13:30:57.195Z","dependency_job_id":"1c9a881f-9db9-4cef-805e-e6c334ff3b68","html_url":"https://github.com/centre-for-humanities-computing/twitter-posting-stats","commit_stats":null,"previous_names":["centre-for-humanities-computing/twitter-posting-stats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/centre-for-humanities-computing/twitter-posting-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centre-for-humanities-computing%2Ftwitter-posting-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centre-for-humanities-computing%2Ftwitter-posting-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centre-for-humanities-computing%2Ftwitter-posting-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centre-for-humanities-computing%2Ftwitter-posting-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centre-for-humanities-computing","download_url":"https://codeload.github.com/centre-for-humanities-computing/twitter-posting-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centre-for-humanities-computing%2Ftwitter-posting-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002966,"owners_count":26083489,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-09T09:13:08.740Z","updated_at":"2025-10-10T06:32:40.829Z","avatar_url":"https://github.com/centre-for-humanities-computing.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitter posting stats\n\nThis project is for gathering posting statistics from Twitter scrapes. Since\nthose scrapes can get pretty big, `pyspark` is used. The data amounts are probably not\nbig enough to merit large Spark clusters, but in principle this should scale to bigger\nand more machines.\n\n## Input data\nThe input data should be line-delimited JSON files of Tweets scraped via the Twitter\nAPI. The Tweet objects should contain these fields as a minimum in this format:\n\n```\n{\n  \"id\": str,\n  \"text\": str,\n  \"created_at\": datetime,\n  \"author_id\": str,\n  \"public_metrics\": {\n    \"retweet_count\": int,\n    \"reply_count\": int,\n    \"like_count\": int,\n    \"quote_count\": int\n  },\n  \"includes\": {\n    \"users\": [\n      {\n        \"id\": str,\n        \"username\": str,\n        \"verified\": bool,\n        \"description\": str,\n        \"protected\": bool,\n        \"name\": str,\n        \"created_at\": datetime,\n        \"public_metrics\": {\n          \"followers_count\": int\n          \"following_count\": int\n          \"tweet_count\": int\n          \"listed_count\": int\n        }\n      }\n    ]\n  }\n}\n```\n\n## How to run\n\nFirst, install the package:\n\n```\npip install -e .\n```\n\n### Extract data from scrapes\nYou can run the Spark app just with Python, e.g.:\n\n```\npython extract-data.py \"input/examples_*.ndjson\"\"\n```\n\nBe mindful of quotes if you use a glob pattern.\n\nYou can also run with `spark-submit` which can give more control over Spark \nconfiguration, in which case you should pass the `-n` (`--no-local`) to the Python\nscript, e.g.:\n\n```\nspark-submit --master \"local[32]\" --driver-memory \"64G\" extract-data.py -n \"input/examples_*.ndjson\"\n```\n\n### Write extracted data to SQLite database\nYou can write the extracted data (tweets and users) to a SQLite database with the \nscripts in `database-setup`, e.g. \n\n```\npython database-setup/tweet-tables.py \"out/examples/tweets/*\" twitter-example\n```\n\nwhich will then create a `twitter-example.db` file.\n\n### Perform analysis on tweets and users\n\n[...]\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentre-for-humanities-computing%2Ftwitter-posting-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentre-for-humanities-computing%2Ftwitter-posting-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentre-for-humanities-computing%2Ftwitter-posting-stats/lists"}