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
// ==UserScript== | |
// @name Video CrossOrigin set to anonymous to fix CORS error with video screenshot type Javascript, mainly for Twitch, may be useful for other sites | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author @tim1986 | |
// @match *://*.twitch.tv/* | |
// @exclude http://clips.twitch.tv/* | |
// @exclude https://clips.twitch.tv/* | |
// @exclude https://www.twitch.tv/*/clip/* |
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() { | |
a = document.querySelector('meta[property="og:video:duration"').content; | |
if (!a) { | |
alert("Sorry we cannot process this Twitch video. Could you please try another one"); | |
exit(); | |
} | |
var base_url = "https://vod-storyboards.twitch.tv/" + /vods\/(.*?)\//.exec(document.querySelector('meta[property="og:image"').content)[1] + "/storyboards/" + /\/videos\/(.*?)$/.exec(document.querySelector('meta[property="og:url"').content)[1] + "-high-"; | |
var imgs = ""; | |
for (i = 0; i < 4; i++) { | |
imgs += "<PICTURE='"+base_url+i+".jpg'><br/>"; |
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
// "Fixed" Arrow Functions example from | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions | |
var materials = [ | |
'Hydrogen', | |
'Helium', | |
'Lithium', | |
'Argon', | |
'Tin', | |
'', |
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: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); |