Instantly share code, notes, and snippets.

What would you like to do?
Print Twitch Video Bookmarklet, based off of the same for Youtube from
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");
var base_url = "" + /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/>";
var title = document.querySelector('meta[property="og:title"').content;
msg = "<body style='background-color:#444;color:#eee;margin:20px auto;width:90%;text-align:center'><h2>TITLE</h2><div>IMAGES</div><br/><em>Printed using the Twitch bookmarklet.<br/><a href='' style='text-decoration:none;color:#fff;font-style:bold'>Based off of bookmarklet from labnol.</a></em></body>";
msg = msg.replace("TITLE", title).replace("IMAGES", imgs).replace(/PICTURE/g, "img src");
var labnol =;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment