Created
June 13, 2012 00:52
-
-
Save codeimpossible/2921095 to your computer and use it in GitHub Desktop.
get number of closed questions from stackoverflow for a certain tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showStats(tag_name) { | |
var script = document.createElement("scr" + "ipt"); | |
script.src = "https://api.stackexchange.com/2.0/questions?fromdate=1336780800&todate=1339459200&order=desc&sort=activity&tagged=" + tag_name + "&site=stackoverflow&callback=renderStats"; | |
console.log(script); | |
$('body').append( script ); | |
} | |
window.renderStats=function( json ) { | |
var num_closed = 0; | |
for(var i = -1, l = json.items.length; ++i < l; ) { | |
var item = json.items[i]; | |
if(item.is_answered) { | |
num_closed++; | |
} | |
} | |
$('#stats').html( num_closed + " questions answered in last 30 days"); | |
}; | |
showStats('ruby-on-rails'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment