{"id":18760452,"url":"https://github.com/stefanbohacek/alternative-twitter-embeds","last_synced_at":"2025-04-13T03:31:09.231Z","repository":{"id":43874761,"uuid":"353501074","full_name":"stefanbohacek/alternative-twitter-embeds","owner":"stefanbohacek","description":"Embed tweets on your site without compromising your users' privacy and your site's performance.","archived":false,"fork":false,"pushed_at":"2023-01-13T18:34:38.000Z","size":399,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T21:11:45.415Z","etag":null,"topics":["nodejs","ownyourdata","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"https://alternative-twitter-embeds.glitch.me/","language":"SCSS","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/stefanbohacek.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-03-31T22:01:13.000Z","updated_at":"2023-11-16T19:28:06.000Z","dependencies_parsed_at":"2023-02-09T16:45:48.120Z","dependency_job_id":null,"html_url":"https://github.com/stefanbohacek/alternative-twitter-embeds","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/stefanbohacek%2Falternative-twitter-embeds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbohacek%2Falternative-twitter-embeds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbohacek%2Falternative-twitter-embeds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbohacek%2Falternative-twitter-embeds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanbohacek","download_url":"https://codeload.github.com/stefanbohacek/alternative-twitter-embeds/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248659619,"owners_count":21141148,"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":["nodejs","ownyourdata","twitter","twitter-api"],"created_at":"2024-11-07T18:12:24.551Z","updated_at":"2025-04-13T03:31:08.921Z","avatar_url":"https://github.com/stefanbohacek.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Alternative Tweet Embeds](https://cdn.glitch.com/73fcfec4-fd90-48b0-acb7-6196517f580b%2Fbanner-772x250.png)\n\n# Alternative Tweet Embeds\n\nEmbed tweets without compromising your users' privacy and your site's performance.\n\nLearn more on [stefanbohacek.com](https://stefanbohacek.com/project/tweet-embeds-wordpress-plugin/). Also available as a [WordPress plugin](https://wordpress.org/plugins/tembeds/).\n\n## How to use\n\nRemix this project and update `.env` file with your own Twitter API keys. (See instructions inside that file.)\n\nYou can then open your project to see how to add necessary `style` and `script` tags to your page.\n\n![View project page](https://cdn.glitch.com/4705ea0a-1577-4255-a4d5-04b4e49626a2%2Fview-project.png?v=1617223621328)\n![Add scripts and styles](https://cdn.glitch.com/4705ea0a-1577-4255-a4d5-04b4e49626a2%2Finclude-files.png?v=1617224227703)\n\n\nBe sure to remove any `script` tags from the [embed code that Twitter gives you](https://help.twitter.com/en/using-twitter/how-to-embed-a-tweet).\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003clink href=\"https://alternative-twitter-embeds.glitch.me/css/styles-bs.css\" rel=\"stylesheet\" type=\"text/css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cTWEET CODE\u003e\n    \u003cscript src=\"https://alternative-twitter-embeds.glitch.me/js/tweets.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nIf you're using Bootstrap v4 on your site, you can load an alternative slimmed down stylesheet.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003clink href=\"https://alternative-twitter-embeds.glitch.me/css/styles.css\" rel=\"stylesheet\" type=\"text/css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cTWEET CODE\u003e\n    \u003cscript src=\"https://alternative-twitter-embeds.glitch.me/js/tweets.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Performance improvements\n\n\nSee a comparison of the PageSpeed performance test results between [this project's page](https://alternative-twitter-embeds.glitch.me/) and the [test page](https://alternative-twitter-embeds.glitch.me/test.html). \n\n![A comparision of PageSpeed performance test results between two pages, one using this project and one using Twitter's scripts](https://cdn.glitch.com/4705ea0a-1577-4255-a4d5-04b4e49626a2%2Fperformance-compare.png?v=1617221434741)\n\n\n- [Project page](https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Falternative-twitter-embeds.glitch.me%2Ftest.html\u0026tab=desktop)\n- [Test page](https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Falternative-twitter-embeds.glitch.me%2F\u0026tab=desktop) ([view test page](https://alternative-twitter-embeds.glitch.me/test.html))\n\n\n## Questions and tips\n\nNeed help or want to share feedback or suggestions? Feel free to reach out [via email](mailto:stefan@stefanbohacek.com) or [on Twitter](https://twitter.com/stefanbohacek)!\n\n### I want to run some code after all tweets are processed\n\nUse the `tembeds_tweets_processed` event.\n\n\n```js\ndocument.addEventListener('tembeds_tweets_processed', () =\u003e {\n  const tweets = document.querySelectorAll('.twitter-tweet');\n  console.log('tweets are ready', tweets);\n});\n```\n\nHere's an example using jQuery.\n\n```js\n$(document).on('tembeds_tweets_processed', () =\u003e {\n  const $tweets = $('.twitter-tweet');\n  console.log('tweets are ready', $tweets);\n});\n```\n\n### How do I prevent others from using my app?\n\nUse the `ALLOWED_URLS` variable inside your `.env` file.\n\n```\nALLOWED_URLS='alternative-twitter-embeds.glitch.me'\n```\n  \nYou can list multiple domains, separated by a comma.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanbohacek%2Falternative-twitter-embeds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanbohacek%2Falternative-twitter-embeds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanbohacek%2Falternative-twitter-embeds/lists"}