{"id":16014726,"url":"https://github.com/pmonks/fake-tweets","last_synced_at":"2025-03-18T03:30:30.796Z","repository":{"id":148948960,"uuid":"259845084","full_name":"pmonks/fake-tweets","owner":"pmonks","description":"Fake tweets generated by a Markov chain built from a Twitter archive","archived":false,"fork":false,"pushed_at":"2024-01-17T18:59:47.000Z","size":95,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-15T15:19:18.535Z","etag":null,"topics":["clojure","markov-chain","tweets","twitter"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmonks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-29T06:37:25.000Z","updated_at":"2023-09-02T11:29:41.000Z","dependencies_parsed_at":"2023-07-22T05:31:17.004Z","dependency_job_id":"53e2a136-f810-422e-83a2-f20e0d9a558c","html_url":"https://github.com/pmonks/fake-tweets","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/pmonks%2Ffake-tweets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmonks%2Ffake-tweets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmonks%2Ffake-tweets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmonks%2Ffake-tweets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmonks","download_url":"https://codeload.github.com/pmonks/fake-tweets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221704875,"owners_count":16866847,"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":["clojure","markov-chain","tweets","twitter"],"created_at":"2024-10-08T15:04:55.658Z","updated_at":"2024-10-27T16:34:36.167Z","avatar_url":"https://github.com/pmonks.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI Status](https://github.com/pmonks/fake-tweets/workflows/CI/badge.svg)](https://github.com/pmonks/fake-tweets/actions?query=workflow%3ACI+branch%3Amain)\n[![Dependencies](https://github.com/pmonks/fake-tweets/workflows/dependencies/badge.svg)](https://github.com/pmonks/fake-tweets/actions?query=workflow%3Adependencies+branch%3Amain)\n[![Open Issues](https://img.shields.io/github/issues/pmonks/fake-tweets.svg)](https://github.com/pmonks/fake-tweets/issues)\n[![License](https://img.shields.io/github/license/pmonks/fake-tweets.svg)](https://github.com/pmonks/fake-tweets/blob/main/LICENSE)\n\n# fake-tweets\n\nA small library that builds a Markov chain from a tweet archive in JSON format, then spits out any number of statistically similar, though fake, tweets.\n\n## Trying it Out\n\n### Providing a JSON Archive\n\nDownload a JSON tweet archive, for example via [Twitter's export function](https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive), using something like [this script](https://gist.github.com/manuchandel/bc8a6ca4b1527b7594945e5091013905), or from [this archive of hot, toxic garbage](https://www.thetrumparchive.com/).\n\nThe JSON must be an array of objects, with each object containing either a `text` or `full_text` key, whose value is the full text of that tweet.  No other keys are used.\n\ne.g.\n\n```JSON\n[\n  {\n    \"source\": \"Twitter for iPhone\",\n    \"text\": \"Who can figure out the true meaning of \\\"covfefe\\\" ???  Enjoy!\",\n    \"created_at\": \"Wed May 31 10:09:22 +0000 2017\",\n    \"retweet_count\": 85555,\n    \"favorite_count\": 209543,\n    \"is_retweet\": false,\n    \"id_str\": \"869858333477523458\"\n  },\n  {\n    \"source\": \"Twitter for iPhone\",\n    \"text\": \"Despite the constant negative press covfefe\",\n    \"created_at\": \"Wed May 31 04:06:25 +0000 2017\",\n    \"retweet_count\": 127507,\n    \"favorite_count\": 162788,\n    \"is_retweet\": false,\n    \"id_str\": \"869766994899468288\"\n  }\n]\n```\n\n### Running the Code\n\nClone this repo, symlink your tweet archive, then start a REPL using the provided init script:\n\n```shell\n$ git clone https://github.com/pmonks/fake-tweets.git\n$ cd fake-tweets\n$ ln -s /path/to/your/tweet-archive.json hot-toxic-garbage.json\n$ clj -i init.clj -r\n```\n\nThis will load and analyse the given tweet archive, then generate one fake tweet up to 100 \"words\" in length.  To generate more:\n\n```clojure\n(ft/fake-tweet markov-chain)\n```\n\nIn addition to the `markov-chain` var, the init script also initialises vars named `vocabulary`, `vocab-freq` and\n`sorted-vocab-freq` which allow primitive analysis of the tweeter's vocabulary using standard Clojure functions:\n\n```clojure\n; How bigly is the tweeter's vocabulary?  Note: punctuation, numbers, emojis, hashtags, @mentions etc. are all included in the count\n(count vocabulary)\n\n; Does the tweeter excrete covfefe?\n(not (empty? (filter #(s/includes? (s/lower-case %) \"covfefe\") vocabulary)))   ; Not idiomatic Clojure, but I don't agree with the rationale...\n\n; How much?\n(get vocab-freq \"covfefe\")\n\n; What are the tweeter's favourite 100 words?\n(take 100 sorted-vocab-freq)\n```\n\n## Contributor Information\n\n[GitHub project](https://github.com/pmonks/fake-tweets)\n\n[Bug Tracker](https://github.com/pmonks/fake-tweets/issues)\n\n## License\n\nCopyright © 2020 Peter Monks Some Rights Reserved\n\n[![Creative Commons License](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc-sa/4.0/)\n\nThis work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).\n\nSPDX-License-Identifier: [CC-BY-NC-SA-4.0](https://spdx.org/licenses/CC-BY-NC-SA-4.0.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmonks%2Ffake-tweets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmonks%2Ffake-tweets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmonks%2Ffake-tweets/lists"}