-
-
Save sayak-sarkar/e509ed4de2fb9fc8cb04 to your computer and use it in GitHub Desktop.
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
// Remap $ to jQuery object | |
var $ = jQuery; | |
// The real fun begins... first catch all the post-anchors & loop on them | |
$(".badge-evt.badge-nsfw-entry-cover").each(function () { | |
// Find out the ID of the post | |
var id = ($(this).attr("href").split("/"))[4]; | |
// Construct the `quite guessable` image URL | |
var url = "http://d3dsacqprgcsqh.cloudfront.net/photo/" + id + "_460s.jpg"; | |
// Put in an image element with source as the formed URL | |
$(this).html("<img src=" + url + " />"); | |
}); | |
// TODO: auto-run after loading new elements on page-scroll, handle GIF vs. JPG, handle post-versions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment