{"id":15497528,"url":"https://github.com/bcomnes/twitter-component","last_synced_at":"2025-04-22T22:04:17.986Z","repository":{"id":57382859,"uuid":"100555848","full_name":"bcomnes/twitter-component","owner":"bcomnes","description":"A native DOM component for embedding tweets","archived":false,"fork":false,"pushed_at":"2017-09-12T01:29:37.000Z","size":381,"stargazers_count":27,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T19:11:31.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://twitter-component.netlify.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcomnes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-17T03:09:25.000Z","updated_at":"2024-11-02T20:11:29.000Z","dependencies_parsed_at":"2022-09-01T04:41:47.072Z","dependency_job_id":null,"html_url":"https://github.com/bcomnes/twitter-component","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Ftwitter-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Ftwitter-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Ftwitter-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Ftwitter-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcomnes","download_url":"https://codeload.github.com/bcomnes/twitter-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250331804,"owners_count":21413100,"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-10-02T08:39:24.048Z","updated_at":"2025-04-22T22:04:17.937Z","avatar_url":"https://github.com/bcomnes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twitter-component [![stability][0]][1]\n[![npm version][2]][3] [![build status][4]][5]\n[![downloads][8]][9] [![js-standard-style][10]][11]\n\nA native DOM component wrapper for embedded tweets.\n\n![](screenshot.png)\n\n## Usage\n\n```js\n// Vanilla JS example\nvar TwitterComponent = require('twitter-component')\n\nvar tweet1 = new TwitterComponent()\nvar tweet2 = new TwitterComponent()\n\ndocument.body.appendChild(tweet1.render('https://twitter.com/uhhyeahbret/status/897603426518876161'))\ndocument.body.appendChild(tweet2.render('https://twitter.com/yoshuawuyts/status/895338700531535878'))\n\n```\n\n## Installation\n```sh\n$ npm install twitter-component\n```\n## API\n### `TwitterComponent = require('twitter-component`)\nImport `TwitterComponent` component class.\n\n### `tweet = new TwitterComponent([opts])`\nCreate a new instance of the twitter component.  `opts` is an options objec that can have the following options:\n\n```js\n{\n  placeholder: true // Enables placeholder text while loading tweet cards\n}\n```\n\n### `tweet.render(tweetURL)`\nReturns a div that, when mounted into the page, will be the target of `twttr.widgets.createTweet`.\nMounting the DOM node returned by `.render` will also load `platform.twitter.com/widgets.js` into the page, and any other side-effects and visitor tracking implications that script brings along with it.\n\n**Twitter employees:** Please release a module version of `platform.twitter.com/widgets.js` because this took 5 hours of freetime™ of just trying to get caught up with your ever changing API and widget ecosystem.\n\nNative DOM component model powered by [nanocomponent][nc] and [nanomorph][nm].\n\n## License\n[MIT](https://tldrlegal.com/license/mit-license)\n\n[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square\n[1]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[2]: https://img.shields.io/npm/v/twitter-component.svg?style=flat-square\n[3]: https://npmjs.org/package/twitter-component\n[4]: https://img.shields.io/travis/bcomnes/twitter-component/master.svg?style=flat-square\n[5]: https://travis-ci.org/bcomnes/twitter-component\n[8]: http://img.shields.io/npm/dm/twitter-component.svg?style=flat-square\n[9]: https://npmjs.org/package/twitter-component\n[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[11]: https://github.com/feross/standard\n[bel]: https://github.com/shama/bel\n[yoyoify]: https://github.com/shama/yo-yoify\n[md]: https://github.com/patrick-steele-idem/morphdom\n[210]: https://github.com/patrick-steele-idem/morphdom/pull/81\n[nm]: https://github.com/yoshuawuyts/nanomorph\n[ce]: https://github.com/yoshuawuyts/cache-element\n[class]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n[isSameNode]: https://github.com/choojs/nanomorph#caching-dom-elements\n[onload]: https://github.com/shama/on-load\n[choo]: https://github.com/choojs/choo\n[nca]: https://github.com/choojs/nanocomponent-adapters\n[nc]: https://github.com/choojs/nanocomponent\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Ftwitter-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcomnes%2Ftwitter-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Ftwitter-component/lists"}