{"id":25636623,"url":"https://github.com/bbecquet/thread-reader-reader","last_synced_at":"2025-04-14T22:11:46.948Z","repository":{"id":39985168,"uuid":"263969330","full_name":"bbecquet/thread-reader-reader","owner":"bbecquet","description":"Parse Twitter thread already simplified by third-party Thread Reader app, and produce dead simple HTML","archived":false,"fork":false,"pushed_at":"2022-12-11T05:57:29.000Z","size":93,"stargazers_count":22,"open_issues_count":7,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T10:11:40.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bbecquet.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":"2020-05-14T16:35:27.000Z","updated_at":"2025-03-06T00:43:22.000Z","dependencies_parsed_at":"2023-01-26T16:35:20.415Z","dependency_job_id":null,"html_url":"https://github.com/bbecquet/thread-reader-reader","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/bbecquet%2Fthread-reader-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fthread-reader-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fthread-reader-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fthread-reader-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbecquet","download_url":"https://codeload.github.com/bbecquet/thread-reader-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"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":[],"created_at":"2025-02-23T00:48:56.293Z","updated_at":"2025-04-14T22:11:46.914Z","avatar_url":"https://github.com/bbecquet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thread-reader-reader\n\nHelps converting Twitter threads to stand-alone articles by extracting them to simple HTML. Relies on the [Thread reader](https://threadreaderapp.com) third-party app.\n\n## Installation\n\n1. Make sure you have Node and NPM installed.\n2. Install the command globally\n   ```\n   npm i -g thread-reader-reader\n   ```\n\n## Usage\n\n1. Submit the first tweet of a Twitter thread to [Thread reader](https://threadreaderapp.com)\n2. Get the resulting URL (Should look like https://threadreaderapp.com/thread/1241364682084093953.html)\n3. Run the CLI program with the following command:\n\n    ```\n    thread-reader-reader \u003cthread_reader_url\u003e\n    ```\n4. The result will be written to the standard output.\n\nTweets will be output in `\u003cp\u003e` divs, and images and videos will be wrapped in a `\u003cfigure\u003e` tag following the paragraph of the tweet they appear in.\n\n### Downloading resources\n\nBy default, original image and video urls will be kept, meaning links will still use the resources stored on Twitter servers.\n\nInstead, you can download these resources locally by adding a path to a local directory as second parameter.\n\n```\nthread-reader-reader \u003cthread_reader_url\u003e [directory_to_store_files]\n```\n\nIn that case, the urls to images and videos will be rewritten with the same path as relative url, replacing Twitter urls.\n\nYou can change this relative url by specifying a third parameter.\n\n```\nthread-reader-reader \u003cthread_reader_url\u003e [directory_to_store_files] [relative_url_path]\n```\n\nThat way, it's easy to adapt to how your destination website stores content.\n\n### Full example\n\nCommand:\n\n```\nthread-reader-reader https://threadreaderapp.com/thread/1241364682084093953.html aquatint-files /public/images/aquatint-files \u003e aquatint-article.html\n```\n\nResult:\n\n - The extracted thread HTML will be written to the `aquatint-article.html` file.\n - In this HTML, urls to images and videos will use `/public/images/aquatint-files` as prefix.\n - Image and video files will be downloaded and stored in the `aquatint-files` directory, ready to be uploaded on your server, in the directory corresponding to `/public/images/aquatint-files`.\n\n\n## As a lib\n\nYou can also use the `parser.js` file as a separate lib.\n\nThe `getTweets` function takes a DOM element as input (JSDom or real DOM will work), basically the document of a Thread Reader page and will return an array of objects:\n\n```js\n{\n    tweetHTML,  // inner markup of the tweet text, including links \n    images,     // array of { url } objects\n    videos      // array of { poster, sources: [{ type, src }] } objects\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fthread-reader-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbecquet%2Fthread-reader-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fthread-reader-reader/lists"}