Created
December 8, 2011 18:06
-
-
Save mduvall/1447866 to your computer and use it in GitHub Desktop.
animates boards on pinterest that have gifs, SUCCESS. and a userscript for chrome
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
$(document).ready(function() { | |
// grab urls for all the images | |
var pin_elems = $("a.PinImage"); | |
$.each(pin_elems, function(i,v) { | |
$.get(v.href, {}, function(data) { | |
$("img", v).attr("src", $("div#PinImage a", $(data)).attr("href")); | |
}); | |
}); | |
}); |
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== | |
// @match http://pinterest.com/maskact/animated-gifs/ | |
// @match http://www.pinterest.com/maskact/animated-gifs/ | |
// @match https://www.pinterest.com/maskact/animated-gifs/* | |
// ==/UserScript== | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
script.textContent = "(" + callback.toString() + ")();"; | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); | |
} | |
function animate() { | |
var pin_elems = $("a.PinImage"); | |
$.each(pin_elems, function(i,v) { | |
$.get(v.href, {}, function(data) { | |
$("img", v).attr("src", $("div#PinImage a", $(data)).attr("href")); | |
}); | |
}); | |
} | |
addJQuery(animate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment