Skip to content

Instantly share code, notes, and snippets.

@dnoseda
Created November 16, 2011 23:47
Show Gist options
  • Save dnoseda/1371899 to your computer and use it in GitHub Desktop.
Save dnoseda/1371899 to your computer and use it in GitHub Desktop.
9gag-unlove.js
// bookmarklet at https://gist.github.com/1371984
javascript:(function(){
var s=document.createElement("script");
s.src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js";
s.onload=function(){
$("ul.actions").map(function(){
var id=$(this).find("a.love").attr("rel");
console.log(id);
var button="<li><a rel=\""+id+"\" id=\"unlo-"+id+"\" class=\"unlove badge-vote-down\" href=\"#\"><span>Unlove</span></a></li>";
$(this).append(button);
});
$("a.unlove").click(function(e){
e.preventDefault();
var id=$(this).attr("rel");
$.get("http://9gag.com/vote/dislike/id/"+id,function(){
$("#unlo-"+id).addClass("unloved");
});
});
};
document.body.appendChild(s);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment