Skip to content

Instantly share code, notes, and snippets.

@oxpa
Last active August 29, 2015 14:03
Show Gist options
  • Save oxpa/f45c695b231e87844c9c to your computer and use it in GitHub Desktop.
Save oxpa/f45c695b231e87844c9c to your computer and use it in GitHub Desktop.
9gag nsfw to image v2
// ==UserScript==
// @name 9gag.test
// @namespace 9gag.com
// @description test
// @include http://9gag.com/gag/*
// @exclude http://9gag.com/hot
// @exclude http://9gag.com/gif
// @version 2
// @run-at document-end
// @grant none
// ==/UserScript==
this.$=this.jQuery=jQuery.noConflict(true);
pst=(window.location.pathname).split("/").slice(-1)[0];
pst=GAG.Configs._configs.data.fast_entries.items[pst].pinImg;
IMG="<img alt='' src='"+pst+"' class='badge-item-img wasnothere'>";
IMG2="<img alt='' style='position:absolute; left:0px;top:0px;' src='"+ pst +"' class='badge-item-img wasnothere'>";
IMG2=IMG2.replace(/700b/,"460sa");
$('.nsfw-post').replaceWith(IMG+IMG2);
$('.wasnothere').parent().removeClass("badge-nsfw-entry-cover");
$('.wasnothere').parent().addClass("badge-post-zoom zoomable");
$('.wasnothere').attr("href","javascript: void(0)");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment