This would actually warrant a separate post. But I can't be bothered to make it look nice. So, if anyone wants to pick it up..
Question voting from the main view
So it was 23:57 and I forgot to spend all my votes for the day. Obviously I didn't write this script right then, but laboriously clicked through interesting questions to upvote one by one. But to save future effort I made this script which adds upvote links directly to the main view / question lists. It's a workaround for one of the issues raised in Why aren't people voting for questions?
// ==UserScript==
// @name Temp
// @description Cheats
// @include http://*stackexchange.com/*
// @include http://*stackoverflow.com/*
// ==/UserScript==
(function(){
/***** if ((new Date).getUTCHours() >= 22) *****/
// voting from main
$("div.question-summary").each(function(){
var id = this.id.substr(17);
if (id)
$(this).find(".vote-count-post").append("<sup style='opacity:0.3'>+</sup>").click(function() {
var url = "/posts/"+id+"/vote/2";
// send POST request to /posts/ID######/vote/2
$.ajax({
type: "POST",
url: url, // #2=up, 3=down, 0=cancel
data: { fkey: StackExchange.options.user.fkey },
dataType: "json",
success: function(result) {
if (result.Success) { // colorful result
$("#question-summary-"+id+" .vote-count-post strong").text(result.NewScore).css({color:"orange"});
}
else {
alert("error occured: " + $.param(result));
}
},
error: function (x, r, e) {
alert("error="+r +" status="+x.status +" exception="+e);
}
});
});
});
})()
###License
Public Domain
###Status
unsupported