Skip to content

Instantly share code, notes, and snippets.

@jamestenglish
Created August 30, 2016 18:55
Show Gist options
  • Save jamestenglish/f2b955d67754e935e263a7ec6fa18f75 to your computer and use it in GitHub Desktop.
Save jamestenglish/f2b955d67754e935e263a7ec6fa18f75 to your computer and use it in GitHub Desktop.
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bvar %24plus %3D ""%3Bvar %24polls %3D ""%3Bvar %24now %3D ""%3B%24("a%5Bdata-model*%3D'plus'%5D")%5B0%5D.click()%3BsetTimeout(function() %7B%24plus %3D %24("div%5Bdata-card-id*%3D'US-winprob'%5D > svg").clone()%3B%7D%2C 1000)%3BsetTimeout(function() %7B%24("a%5Bdata-model*%3D'polls'%5D")%5B0%5D.click()%3B%7D%2C 2000)%3BsetTimeout(function() %7B%24polls %3D %24("div%5Bdata-card-id*%3D'US-winprob'%5D > svg").clone()%3B%7D%2C 3000)%3BsetTimeout(function() %7B%24("a%5Bdata-model*%3D'now'%5D")%5B0%5D.click()%3B%7D%2C 4000)%3BsetTimeout(function() %7B%24now %3D %24("div%5Bdata-card-id*%3D'US-winprob'%5D > svg").clone()%3B%7D%2C 5000)%3BsetTimeout(function() %7B%24('body').children().remove()%3B%24('body').append(%24plus)%3B%24('body').append(%24polls)%3B%24('body').append(%24now)%3B%7D%2C 6000)%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@jamestenglish
Copy link
Author

jamestenglish commented Aug 30, 2016

a minified, bookmarklet-ized version of this:

var $plus = "";
var $polls = "";
var $now = "";

$("a[data-model*='plus']")[0].click();
setTimeout(function() {
    $plus = $("div[data-card-id*='US-winprob'] > svg").clone();
}, 1000);

setTimeout(function() {
    $("a[data-model*='polls']")[0].click();
}, 2000);

setTimeout(function() {
    $polls = $("div[data-card-id*='US-winprob'] > svg").clone();
}, 3000);   

setTimeout(function() {
    $("a[data-model*='now']")[0].click();
}, 4000);

setTimeout(function() {
    $now = $("div[data-card-id*='US-winprob'] > svg").clone();
}, 5000);

setTimeout(function() {
    $('body').children().remove();
    $('body').append($plus);
    $('body').append($polls);
    $('body').append($now);
}, 6000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment