Skip to main content
retagged as it's a script not an app
Link
SztupY
  • 713
  • 3
  • 11
updated to API 2.1
Source Link
SztupY
  • 713
  • 3
  • 11

It's the following line (JavaScript - 388456 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.$2stackexchange.com/12.0$31$3?answers=true'filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){b=x.questions[0];$items[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 exactly like on Stack Overflow. 521589 characters, so it might not work with Internet Explorer (that has a limit of 508 chars).

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html(s+'green">'+(q[h]?'+':'')+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.$2stackexchange.com/12.0$31$3?answers=true'filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){b=x.questions[0];witems[0];w('#question'+c,b);$.each(b.answers,function(z,y){w('#answer-'+y.answer_id+c,y)})}})})()

Here is another one you can use on the frontpagefront or similar pages to quickly identify controversial topics:

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html('<div class=".mini-counts">'+s+'green">'+(q[h]?'+':'')+q[h]+k+s+'maroon">'+(q[j]==0?'':'-')+q[j]+k+k)};a='jsonp';c=' .votes';$votes';v=$(".ajaxquestion-summary").map( function(){return this.id.replace(/question-summary-/,'');}).get().join(";");$.ajax({url:document.location.href.replace(/(http:\/\/)([^\[^/]*).*/,'$1api.$2stackexchange.com/12.01/questions'questions/'+v+'?filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){$.each(x.questionsitems,function(z,b){w('#question-summary-'+b.question_id+c,b);})}})})()

It was written in Notepad already in minified form, and I used Firebug to debug. (API 2.1 version was tested in Chrome's console) Code is above. Contribute (=decrease code size or make the output nicer) any way you want. It would be great if you'd make the second code shorter than 508 bytes.

  • If a question has more than 30100 answers then some of the answers won't be resolved. This can be solved easily for less than 100 answers, but forFor questions with more than 100 answers resolving this is more difficult (= longer script)

EDIT: updated to API version 12.01.

It's the following line (JavaScript - 388 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/1.0$3?answers=true'),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 exactly like on Stack Overflow. 521 characters, so it might not work with Internet Explorer.

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html(s+'green">'+(q[h]?'+':'')+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/1.0$3?answers=true'),dataType:a,jsonp:a,success:function(x){b=x.questions[0];w('#question'+c,b);$.each(b.answers,function(z,y){w('#answer-'+y.answer_id+c,y)})}})})()

Here is another one you can use on the frontpage:

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html('<div class=".mini-counts">'+s+'green">'+(q[h]?'+':'')+q[h]+k+s+'maroon">'+(q[j]==0?'':'-')+q[j]+k+k)};a='jsonp';c=' .votes';$.ajax(  {url:document.location.href.replace(/(http:\/\/)([^\/]*)/,'$1api.$2/1.0/questions'),dataType:a,jsonp:a,success:function(x){$.each(x.questions,function(z,b){w('#question-summary-'+b.question_id+c,b);})}})})()

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

  • If a question has more than 30 answers then some of the answers won't be resolved. This can be solved easily for less than 100 answers, but for questions with more than 100 answers this is more difficult

EDIT: updated to API version 1.0.

It's the following line (JavaScript - 456 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.stackexchange.com/2.1$3?filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){b=x.items[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 exactly like on Stack Overflow. 589 characters, so it might not work with Internet Explorer (that has a limit of 508 chars).

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html(s+'green">'+(q[h]?'+':'')+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.stackexchange.com/2.1$3?filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){b=x.items[0];w('#question'+c,b);$.each(b.answers,function(z,y){w('#answer-'+y.answer_id+c,y)})}})})()

Here is another one you can use on the front or similar pages to quickly identify controversial topics:

javascript:(function(){w=function(t,q){l='_vote_count';h='up'+l;j='down'+l;k='</div>';s='<div style="color:';$(t).html('<div class=".mini-counts">'+s+'green">'+(q[h]?'+':'')+q[h]+k+s+'maroon">'+(q[j]==0?'':'-')+q[j]+k+k)};a='jsonp';c=' .votes';v=$(".question-summary").map(function(){return this.id.replace(/question-summary-/,'');}).get().join(";");$.ajax({url:document.location.href.replace(/(http:\/\/)([^/]*).*/,'$1api.stackexchange.com/2.1/questions/'+v+'?filter=!*1Kh6Cl014HkvD72tuSfJO9y3iR3BWcrbu)tZ20Hd&site=$2&pagesize=100'),dataType:a,jsonp:a,success:function(x){$.each(x.items,function(z,b){w('#question-summary-'+b.question_id+c,b);})}})})()

It was written in Notepad already in minified form, and I used Firebug to debug. (API 2.1 version was tested in Chrome's console) Code is above. Contribute (=decrease code size or make the output nicer) any way you want.

  • If a question has more than 100 answers then some of the answers won't be resolved. For questions with more than 100 answers resolving this is more difficult (= longer script)

EDIT: updated to API version 2.1.

VoteCounts: bookmarklet to display up/down votes even for rep<1krep less than 1000

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 repreputation points, but want to check the stats of the more controversial questions (usually on metaMeta Stack Overflow).

I don't think a code like this deserves anything other than WTFPL.

It's the following line (javascriptJavaScript - 388 bytes):.

EDIT: This is longer, but it will make the result look like exactly like on SOStack Overflow. 521 charscharacters, so it might not workswork with IEInternet Explorer.

For any jqueryjQuery/bookmarklets compatible browser. Tested with Chrome, FF3Firefox 3.6 and IE8Internet Explorer 8 for SUSuper User,SO Stack Overflow,MSO and Meta Stack Overflow.

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

  • If a question has more than 30 answers then some of the answers won't be resolved. This can be solved easily for <=100less than 100 answers, but for questions with more than 100 answers this is more difficult

VoteCounts: bookmarklet to display up/down votes even for rep<1k

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)

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

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

EDIT: This is longer, but it will make the result look like exactly on SO. 521 chars, so it might not works with IE.

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

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.

  • If a question has more than 30 answers then some of the answers won't be resolved. This can be solved easily for <=100 answers, but for questions with more than 100 answers this is more difficult

VoteCounts: bookmarklet to display up/down votes even for rep less than 1000

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 reputation points, but want to check the stats of the more controversial questions (usually on Meta Stack Overflow).

I don't think a code like this deserves anything other than WTFPL.

It's the following line (JavaScript - 388 bytes).

EDIT: This is longer, but it will make the result look exactly like on Stack Overflow. 521 characters, so it might not work with Internet Explorer.

For any jQuery/bookmarklets compatible browser. Tested with Chrome, Firefox 3.6 and Internet Explorer 8 for Super User, Stack Overflow, and Meta Stack Overflow.

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

  • If a question has more than 30 answers then some of the answers won't be resolved. This can be solved easily for less than 100 answers, but for questions with more than 100 answers this is more difficult
added 523 characters in body
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
Fixed for API 1.0 with answers
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
1.0 update
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
First 0.9 update
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
second code made into 508 chars; added 2 characters in body
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
added a second type of code; added 73 characters in body
Source Link
SztupY
  • 713
  • 3
  • 11
Loading
Source Link
SztupY
  • 713
  • 3
  • 11
Loading