Embed Code Snippets, Images, Gifs, Videos, Gists, & more on Discord, Slack, Telegram, Twitter, etc.
You can either:
- Add
rx
before yourgithub.com
link to make itrxgithub.com
, OR - Intall the bookmarklet it by highlighting the contents of the above code block, and then dragging it to your bookmark toolbar. Clicking on the bookmarklet will copy the rxgithub enabled URL to your clipboard. (source)
javascript:(function()%7Bconst%20githubUrl%20%3D%20%22https%3A%2F%2Fgithub.com%22%3B%0Aif%20(window.location.href.startsWith(githubUrl))%20%7B%0A%20%20%20%20const%20rxGithubUrl%20%3D%20%22https%3A%2F%2Frxgithub.com%22%20%2B%20window.location.href.substring(githubUrl.length)%3B%0A%20%20%20%20navigator.clipboard.writeText(rxGithubUrl)%3B%0A%7D%7D)()%3B
When a request hits an rxgithub.com
URL, the user-agent is matched against a list of well-known bot user-agents. If the request appears to be from a bot, an HTML webpage is shown with all the required <meta>
tags for Open-Graph compatibility. Otherwise, browser users are redirected to the original GitHub URL.
A HEAD
request is made to the associated raw.githubusercontent.com
URL to determine the Content-Type
and it shows the appropriate <meta>
tags for the content.
If the content is either code or an SVG, the server generates an image on the fly to serve to the open-graph crawler.