Last active
December 2, 2023 19:00
-
-
Save framegrabber/df3e4bf48faf793d214ad638143a8db9 to your computer and use it in GitHub Desktop.
Bookmarklet to generate a Markdown formatted image link to a YouTube Video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function() { | |
var url = window.location.href; | |
var videoId = url.match(/watch\?v=([^&#]+)/)[1]; | |
var title = document.title; | |
var markdownLink = `[![${title}](https://img.youtube.com/vi/${videoId}/0.jpg "${title}")](${url})`; | |
navigator.clipboard.writeText(markdownLink); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment