##Screenshot / Code Snippet

![https://i.sstatic.net/i5Szg.png][1]

##About

This small bookmarklet will allow anyone to use the "vulnerability" of the API that it allows you to check the up/down vote count - a feat you could normally achieve by being a 1k+rep user. Mainly useful for sites where you don't have this amount of rep, but want to check the stats of the more controversial questions (usually on meta)

No API key is actually used here, but it's trivial to add one.

###License

I don't think a code like this deserves anything other than [WTFPL][2]

###Download


It's the following line (javascript - 375 bytes):

    javascript:(function(){a='jsonp';c=' .vote-count-post';d='up_vote_count';e='down_vote_count';$.ajax({url:document.location.href.replace(/(http:\/\/)(.*)(\/questions\/.*)\/.*/,'$1api.$2/0.8$3'),dataType:a,jsonp:a,success:function(x){b=x.questions[0];$('#question'+c).html(b[d]+"-"+b[e]);$.each(b.answers,function(z,y){$('#answer-'+y.answer_id+c).html(y[d]+"-"+y[e])})}})})()

EDIT: This is longer, but it will make the result look like exactly on SO. Couldn't make it below 508 (it's 522), and it's already unmaintainable (maybe adding some test would help :) ), so it wont work with IE.

    javascript:(function(){w=function(q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';return s+'green">'+(q[h]>0?'+':'')+q[h]+k+'<div class="vote-count-separator">'+k+s+'maroon">'+(q[j]==0?'':'-')+q[j]+k};a='jsonp';c=' .vote-count-post';$.ajax({url:document.location.href.replace(/(http:\/\/)(.*)(\/questions\/.*)\/.*/,'$1api.$2/0.8$3'),dataType:a,jsonp:a,success:function(x){b=x.questions[0];$('#question'+c).html(w(b));$.each(b.answers,function(z,y){$('#answer-'+y.answer_id+c).html(w(y))})}})})()

###Platform

For any jquery/bookmarklets compatible browser. Tested with Chrome, FF3.6 and IE8 for SU,SO,MSO

##Contact

[sztupy.hu][3]

##Code

It was written in notepad already in minified form. Used firebug to debug. Code is above. Contribute(=decrease code size or make the output nicer) any way you want. I'd be great if you'd do the second code shorter than 508 bytes.


  [1]: https://i.sstatic.net/i5Szg.png
  [2]: http://sam.zoy.org/wtfpl/
  [3]: http://sztupy.hu