{"id":22092222,"url":"https://github.com/pirxpilot/tweet-html","last_synced_at":"2025-07-24T20:32:09.229Z","repository":{"id":12655223,"uuid":"15326954","full_name":"pirxpilot/tweet-html","owner":"pirxpilot","description":"reparse tweets returned by twitter API to HTML","archived":false,"fork":false,"pushed_at":"2022-06-05T07:59:58.000Z","size":66,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-05T18:57:36.507Z","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/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","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":"2013-12-20T01:15:15.000Z","updated_at":"2022-06-05T07:58:56.000Z","dependencies_parsed_at":"2022-09-10T06:12:48.224Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/tweet-html","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Ftweet-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Ftweet-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Ftweet-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Ftweet-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/tweet-html/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227476143,"owners_count":17779417,"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":"2024-12-01T03:08:46.492Z","updated_at":"2024-12-01T03:08:47.397Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n[![Dependency Status][deps-image]][deps-url]\n\n  reparse tweets returned by twitter API to HTML\n\n## Installation\n\nInstall with [npm](http://npmjs.org):\n\n    $ npm install tweet-html\n\n## API\n\n### tweet2html(tweet, username[, options])\n\nParse [tweet entities] contained in [tweet] object returned by one of the [Twitter API] calls.\n\n- `tweet` - tweet object\n- `username` -\n- `opts` - _optional_ - at the moment only `formatDate` is supported; if not provided `created_at`\n  dates are formated to display _3 hours ago_ or _a year ago_\n\nIn addition to usual suspects (user mentions, hashtags, urls) it also parses and embeds vine,\ninstagram, youtube and vimeo links.\n\nGiven:\n\n```json\n{\n  \"id_str\": \"413684211087048704\",\n  \"created_at\": \"Thu Dec 19 14:56:16 +0000 2013\",\n  \"text\": \"Look for the East Byrneside boarder cross course this weekend! https://t.co/zbGXyOjmlr\",\n  \"entities\": {\n    \"urls\": [\n      {\n        \"url\": \"https://t.co/zbGXyOjmlr\",\n        \"expanded_url\": \"https://vine.co/v/h0UBzVLzA5O\",\n        \"display_url\": \"vine.co/v/h0UBzVLzA5O\",\n        \"indices\": [\n          63,\n          86\n        ]\n      }\n    ]\n  }\n}\n```\n\nRenders:\n\n```html\n\u003ca href=\"https://twitter.com/stratton/status/413684211087048704\" target=\"_blank\" class=\"date\"\u003e\n  '3 days ago'\n\u003c/a\u003e\n\u003cdiv class=\"text\"\u003eLook for the East Byrneside boarder cross course this weekend!\u003c/div\u003e\n\u003ciframe src=\"https://vine.co/v/h0UBzVLzA5O/embed/simple\" class=\"video vine\"\u003e\u003c/iframe\u003e\n```\n\nCheck [tests](test/tweet-html.js) for more examples.\n\n\n## License\n\n  MIT\n\n[tweet]: https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object\n[tweet entities]: https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/entities-object\n[Twitter API]: https://developer.twitter.com/en/docs/api-reference-index\n\n[npm-image]: https://img.shields.io/npm/v/tweet-html\n[npm-url]: https://npmjs.org/package/tweet-html\n\n[build-url]: https://github.com/pirxpilot/tweet-html/actions/workflows/check.yaml\n[build-image]: https://img.shields.io/github/workflow/status/pirxpilot/tweet-html/check\n\n[deps-image]: https://img.shields.io/librariesio/release/npm/tweet-html\n[deps-url]: https://libraries.io/npm/tweet-html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Ftweet-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Ftweet-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Ftweet-html/lists"}