{"id":13612259,"url":"https://github.com/rob-murray/jekyll-twitter-plugin","last_synced_at":"2025-04-12T21:30:00.985Z","repository":{"id":55425225,"uuid":"24814658","full_name":"rob-murray/jekyll-twitter-plugin","owner":"rob-murray","description":"A Liquid tag plugin for the Jekyll blogging engine that embeds Tweets, Timelines and more from Twitter API","archived":false,"fork":false,"pushed_at":"2021-03-25T22:32:09.000Z","size":957,"stargazers_count":235,"open_issues_count":10,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T01:07:37.407Z","etag":null,"topics":["jekyll","ruby","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/rob-murray.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":"2014-10-05T11:50:03.000Z","updated_at":"2025-03-22T18:19:13.000Z","dependencies_parsed_at":"2022-08-15T00:01:01.159Z","dependency_job_id":null,"html_url":"https://github.com/rob-murray/jekyll-twitter-plugin","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-murray%2Fjekyll-twitter-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-murray%2Fjekyll-twitter-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-murray%2Fjekyll-twitter-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-murray%2Fjekyll-twitter-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rob-murray","download_url":"https://codeload.github.com/rob-murray/jekyll-twitter-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248634800,"owners_count":21137119,"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":["jekyll","ruby","twitter-api"],"created_at":"2024-08-01T20:00:25.825Z","updated_at":"2025-04-12T21:30:00.949Z","avatar_url":"https://github.com/rob-murray.png","language":"Ruby","funding_links":[],"categories":["Tags","Ruby"],"sub_categories":[],"readme":"\u003cimg alt=\"Screenshot embedded tweet\" src=\"https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/media/embedded-tweet.png\" align=\"right\" /\u003e\n\n# jekyll-twitter-plugin\n\nA Liquid tag plugin for the Jekyll blogging engine that embeds Tweets, Timelines and more from Twitter API.\n\n[![Build Status](https://travis-ci.org/rob-murray/jekyll-twitter-plugin.svg?branch=master)](https://travis-ci.org/rob-murray/jekyll-twitter-plugin)\n[![Gem Version](https://badge.fury.io/rb/jekyll-twitter-plugin.svg)](http://badge.fury.io/rb/jekyll-twitter-plugin)\n\n---\n\n\n## Description\n\n**jekyll-twitter-plugin** is a Liquid tag plugin for [Jekyll](http://jekyllrb.com/) that enables Twitter content to be used in any pages generated by Jekyll. Content is fetched from the [Twitter Publish platform](https://publish.twitter.com).\n\nThe [Publish platform](https://publish.twitter.com) allows Twitter users to curate content for display outside of Twitter. You can display many different types of content with the familiar Twitter styling. We use this API and allow any customisation of the content that is accepted by the Twitter publish platform.\n\n\u003e You can now embed any Twitter content in your Jekyll powered blog!\n\n### Here are a few examples\n\n#### Tweet\n\nAn example of a Tweet - `{% twitter https://twitter.com/rubygems/status/518821243320287232 %}`\n\n![Embedded tweet](https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/media/embedded-tweet.png \"Screenshot of embedded tweet\")\n\n#### Timeline\n\nAn example of a Timeline - `{% twitter https://twitter.com/jekyllrb maxwidth=500 limit=5 %}`\n\n![Embedded timeline](https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/media/embedded-timeline.png \"Screenshot of embedded timeline\")\n\n#### Grid Timeline\n\nAn example of a Grid Timeline - `{% twitter https://twitter.com/TwitterDev/timelines/539487832448843776 limit=5 widget_type=grid maxwidth=500 %}`\n\n![Embedded Grid Timeline](https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/media/embedded-grid.png \"Screenshot of embedded Grid Timeline\")\n\n#### Moment\n\nAn example of a Moment - `{% twitter https://twitter.com/i/moments/650667182356082688 maxwidth=500 %}`\n\n![Embedded moment](https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/media/embedded-moment.png \"Screenshot of embedded moment\")\n\n\n### Features\n\nThe plugin supports the following features:\n\n* Installed via Rubygems.\n* [Customisation](#customisation) - All customisation options passed to Twitter API.\n* [Authentication](#authentication) - No authentication required!\n* [Caching](#caching) - Twitter API responses can be cached to speed up builds.\n\n\n## Getting Started\n\nAs mentioned by [Jekyll's documentation](http://jekyllrb.com/docs/plugins/#installing-a-plugin) you have two options; manually import the source file, or require the plugin as a `gem`.\n\n\n#### Require gem\n\nInstall the gem, add it to your Gemfile;\n\n```ruby\ngem 'jekyll-twitter-plugin'\n```\n\nAdd the `jekyll-twitter-plugin` to your site `_config.yml` file for Jekyll to import the plugin as a gem.\n\n```ruby\nplugins: ['jekyll-twitter-plugin']\n```\n\n#### Manual import\n\n\u003e Note: this is deprecated and support will be removed in a later version.\n\nJust download the source file into your `_plugins` directory, e.g.\n\n```bash\n# Create the _plugins dir if needed and download project_version_tag plugin\n$ mkdir -p _plugins \u0026\u0026 cd _plugins\n$ wget https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/lib/jekyll-twitter-plugin.rb\n```\n\n\n#### Plugin tag usage\n\nTo use the plugin, in your source content use the tag `twitter` and then pass additional options to the plugin. These are passed to the API.\n\n```liquid\n{% plugin_type twitter_url *options %}\n\n# Example for timeline of the **jekyllrb** user with a maximum of 5 Tweets and with a width of 500px\n{% twitter https://twitter.com/jekyllrb maxwidth=500 limit=5 %}\n```\n\n| Argument      | Required? | Description                                                                                                                   |\n| ---           | ---       | ---                                                                                                                           |\n| `plugin_type` | Yes       | Either `twitter` or `twitternocache` (same as `twitter` but does not cache api responses)                                     |\n| `twitter_url` | Yes       | The Twitter URL to use, check below for supported URLs.                                                                       |\n| `*options`    | No        | Parameters for the API separated by spaces. Refer below and to respective Twitter API documentation for available parameters. |\n\n#### Custom variables\n\nIn addition to passing the Twitter URL directly to the plugin, you can also use [Front Matter](https://jekyllrb.com/docs/front-matter/) to store URLs as page variables. This allows you to re-use view configuration or partials by keeping the Twitter URL(s) separate to page content.\n\n```liquid\n---\ntitle: My page\ntweets:\n  - https://twitter.com/dhh/status/1162426045405921282\n  - https://twitter.com/rails/status/1205565185739673600\na_tweet: https://twitter.com/rubygems/status/518821243320287232\n---\n\n{% for tweet in page.tweets %}\n  {% twitter tweet align=right width=350 %}\n{% endfor %}\n\n{% twitter page.a_tweet %}\n```\n\n### Supported Twitter URLs\n\nThe Twitter URLs that are supported depend on Twitter. We pass the url and all parameters to the API - check [Twitter Publish platform](https://publish.twitter.com) for availability. Here is documentation for some common types:\n\n##### Tweet:\n\n* [https://developer.twitter.com/en/docs/twitter-for-websites/overview](https://developer.twitter.com/en/docs/twitter-for-websites/overview)\n* [https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed)\n* [https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference](https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference)\n\n##### Timeline:\n\n* [https://developer.twitter.com/en/docs/twitter-for-websites/timelines/overview](https://developer.twitter.com/en/docs/twitter-for-websites/timelines/overview)\n* [https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/oembed-api](https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/oembed-api)\n* [https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/parameter-reference](https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/parameter-reference)\n\n##### Moments:\n\n* [https://developer.twitter.com/en/docs/twitter-for-websites/moments/overview](https://developer.twitter.com/en/docs/twitter-for-websites/moments/overview)\n* [https://developer.twitter.com/en/docs/twitter-for-websites/moments/guides/oembed-api](https://developer.twitter.com/en/docs/twitter-for-websites/moments/guides/oembed-api)\n* [https://developer.twitter.com/en/docs/twitter-for-websites/moments/guides/parameter-reference0](https://developer.twitter.com/en/docs/twitter-for-websites/moments/guides/parameter-reference0)\n\n### Customisation\n\nAll pairs of options and values after the URL are passed to the API. The parameters must be in pairs with the option as the key: `option=value`.\n\nFor example, if you want to limit the width of the embedded content then the API supports a `maxwidth` option so you could construct the tag as below to limit it to a value of 500 (pixels).\n\n```liquid\n{% twitter https://twitter.com/jekyllrb maxwidth=500 %}\n```\n\n### Authentication\n\nThe API does not require any authentication.\n\n\u003e Previous version of this library used an API that required API keys (TWITTER_CONSUMER_KEY TWITTER_CONSUMER_SECRET TWITTER_ACCESS_TOKEN TWITTER_ACCESS_TOKEN_SECRET). We now print a warning if these are detected as a reminder that you can safely remove them.\n\n\n### Output\n\nAll content will be rendered inside a div with the class `jekyll-twitter-plugin`.\n\n```html\n\u003cdiv class='jekyll-twitter-plugin'\u003e\n    -- content from API --\n\u003c/div\u003e\n```\n\nIf something goes wrong, then a basic error message will be displayed:\n\n\u003e Tweet could not be processed\n\nIf we receive an error from the API then a message will be cached and rendered something like this below. If it's a 404, then this suggests the Tweet is protected or deleted.  I will not be fetched again and again. If the Tweet is restored, then simply delete the cached response from `.tweet-cache` directory and build again.\n\n```html\n\u003cdiv class='jekyll-twitter-plugin'\u003e\n    \u003cp\u003eThere was a '{error name}' error fetching Tweet '{Tweet status url}'\u003c/p\u003e\n\u003c/div\u003e\n```\n\n### Caching\n\nTwitter API responses can be cached to speed up Jekyll site builds. The reponses will be cached in a directory within your Jekyll project called `.tweet-cache`. This should not be committed to source control.\n\nCaching is enabled by using the `twitter` tag.\n\nIt is possible to disable caching by using the specific `twitternocache` tag.\n\n```liquid\n{% twitternocache twitter_url *options %}\n\n# Example\n{% twitternocache https://twitter.com/rubygems/status/518821243320287232 %}\n\n```\n\n\n### Contributions\n\nI've tried hard to keep all code in the one `lib/jekyll-twitter-plugin.rb` file so that people can just grab this file and include in their Jekyll `_plugins` directory if they do not want to install with Rubygems. This will be dropped in a later version.\n\nPlease use the GitHub pull-request mechanism to submit contributions.\n\nThere is a quick integration test in `spec/integration_tests.rb` that will use the **jekyll-twitter-plugin** public api and output a file `output_test.html`. Run this with the following command:\n\n```ruby\n$ ruby spec/integration_tests.rb \u0026\u0026 open output_test.html\n```\n\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/rob-murray/jekyll-twitter-plugin/tags).\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-murray%2Fjekyll-twitter-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob-murray%2Fjekyll-twitter-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-murray%2Fjekyll-twitter-plugin/lists"}