Skip to content

Instantly share code, notes, and snippets.

@tballas
Last active April 21, 2016 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tballas/50f44d4a4b7a2e4c2ddf6b193de17f31 to your computer and use it in GitHub Desktop.
Save tballas/50f44d4a4b7a2e4c2ddf6b193de17f31 to your computer and use it in GitHub Desktop.
Bookmarklet to create Youtube Screenshot to Imgur. To replace youtubescreenshot.com that is kind of broken or not working. You *MUST* be on a youtube video with a timecode in the URL. To get this to work: Replace "INSERT_IMGUR_CLIENTID" with your imgur client id Get it here: https://api.imgur.com/oauth2/addclient
javascript:void function(e){var t=function(e){function t(e){window.open(e.data.link)}var a=document.getElementsByTagName("meta");length=a.length;for(var n=0;n<length;n++)if("og:image"==a[n].getAttribute("property"))var o=a[n].getAttribute("content");var r="INSERT_IMGUR_CLIENTID",i=o;e.ajax({url:"https://api.imgur.com/3/image",type:"POST",datatype:"json",data:{image:i},success:t,error:t,beforeSend:function(e){e.setRequestHeader("Authorization","Client-ID "+r)}})},a=e&&e.fn&&parseFloat(e.fn.jquery)>=1.7;if(a)t(e);else{var n=document.createElement("script");n.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js",n.onload=n.onreadystatechange=function(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||t(jQuery.noConflict())}}document.getElementsByTagName("head")[0].appendChild(n)}(window.jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment