Created
January 10, 2020 14:45
-
-
Save bhachauk/b1c16acae88dff5a3b289e7fe23dc2dc to your computer and use it in GitHub Desktop.
StackOverflow information
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
<h3>Stack overflow Repuration</h3> | |
<div id="stack-rep">Value</div> | |
<script> | |
function getJSON(url) { | |
var resp ; | |
var xmlHttp ; | |
resp = '' ; | |
xmlHttp = new XMLHttpRequest(); | |
if(xmlHttp != null) | |
{ | |
xmlHttp.open( "GET", url, false ); | |
xmlHttp.send( null ); | |
resp = xmlHttp.responseText; | |
} | |
return resp ; | |
} | |
myinfo = JSON.parse(getJSON('https://api.stackexchange.com/2.2/users/8331235?order=desc&sort=reputation&site=stackoverflow')); | |
console.log(myinfo.items[0].reputation); | |
document.getElementById("stack-rep").title = myinfo.items[0].reputation; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment