{"id":15359231,"url":"https://github.com/hugovk/inxwords","last_synced_at":"2025-07-10T06:07:35.554Z","repository":{"id":26935306,"uuid":"30397763","full_name":"hugovk/inXwords","owner":"hugovk","description":"Find a trending topic along the lines of #YinXwords and tweet a random X-word sentence from Project Gutenberg.","archived":false,"fork":false,"pushed_at":"2022-02-28T12:40:14.000Z","size":1019,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T20:05:18.283Z","etag":null,"topics":["bot","gutenberg","python","twitterbot"],"latest_commit_sha":null,"homepage":"https://twitter.com/inXwords","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/hugovk.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}},"created_at":"2015-02-06T06:02:15.000Z","updated_at":"2019-12-22T19:26:11.000Z","dependencies_parsed_at":"2022-09-02T01:41:22.526Z","dependency_job_id":null,"html_url":"https://github.com/hugovk/inXwords","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hugovk/inXwords","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugovk%2FinXwords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugovk%2FinXwords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugovk%2FinXwords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugovk%2FinXwords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugovk","download_url":"https://codeload.github.com/hugovk/inXwords/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugovk%2FinXwords/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264537910,"owners_count":23624426,"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":["bot","gutenberg","python","twitterbot"],"created_at":"2024-10-01T12:44:09.897Z","updated_at":"2025-07-10T06:07:35.526Z","avatar_url":"https://github.com/hugovk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @inXwords\n\n[![Build Status](https://travis-ci.org/hugovk/inXwords.svg?branch=master)](https://travis-ci.org/hugovk/inXwords)\n[![Coverage Status](https://coveralls.io/repos/github/hugovk/inXwords/badge.svg?branch=master)](https://coveralls.io/github/hugovk/inXwords?branch=master)\n\nFind a trending topic along the lines of #YinXwords and tweet a random X-word sentence from Project Gutenberg.\n\nSee it in action at **[![](https://abs.twimg.com/favicons/favicon.ico)@inXwords](https://twitter.com/inXwords)** and some of the best at [![](http://favstar.fm/favicon.ico)http://favstar.fm/users/inXwords](http://favstar.fm/users/inXwords).\n\nInspired by Darius Kazemi's [#FiveWordsToRuinADate](http://tinysubversions.com/stuff/fivewords/), and [GenGen](http://tinysubversions.com/gengen/), with which I made this [prototype](http://tinysubversions.com/gengen/gen.html?key=1Fe83835N-GoCl_g6iGGVWpSoJIgRvm-StuFhnt54kWk). I like that Darius's generators are powered by his [gutencorpus](https://github.com/dariusk/gutencorpus), which was inspired by my [gutengrep](https://github.com/hugovk/gutengrep), and gutengrep is used here. Full circle!\n\n## Set up\n\nFirst we need some lists of sentences from Project Gutenberg. For this I used a tool called [gutengrep](https://github.com/hugovk/gutengrep) on the [August 2003 CD](http://www.gutenberg.org/wiki/Gutenberg:The_CD_and_DVD_Project) (\"contains 600 of our best Ebooks\").\n\n1. Put all Gutenberg text files in the same directory and `cd` to it.\n2. `gutengrep.py \"^\\w+\\s\\w+\\s\\w+[\\.?\\!]$\" --cache \u003e /tmp/3.txt`\n3. `edit /tmp/3.txt`\n4. Edit out guff at start and end\n5. `sort /tmp/3.txt | uniq \u003e /tmp/3-word-sentences.txt`\n6. Repeat for four, five and six-word sentences.\n7. `wc -l /tmp/*.txt`\n```bash\n   23949 /tmp/3-word-sentences.txt\n   91551 /tmp/3.txt\n   31396 /tmp/4-word-sentences.txt\n  107418 /tmp/4.txt\n   29835 /tmp/5-word-sentences.txt\n   94720 /tmp/5.txt\n```\n\n8\\. Then create a [new Twitter application](https://apps.twitter.com/app/new), a [new Twitter account](https://twitter.com/signup), authorise them using [this](http://i.puthtml.com/boodooperson/twurl) or [that](\nhttps://gist.github.com/moonmilk/035917e668872013c1bd#comment-1333900), fill in the keys in inxwords.yaml, and run something like:\n\n```bash\npython inxwords.py  --no-web --loop --yamp /path/to/inxwords.yaml --sendir /path/to/dir/of/gutenberg/sentences\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugovk%2Finxwords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugovk%2Finxwords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugovk%2Finxwords/lists"}