Skip to content

Instantly share code, notes, and snippets.

@eyeballcode
Created July 26, 2015 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyeballcode/a61da65fdf6db6e60be3 to your computer and use it in GitHub Desktop.
Save eyeballcode/a61da65fdf6db6e60be3 to your computer and use it in GitHub Desktop.
StackAPITokenTest
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://teamfreehugs.github.io/js/StackAPI.js"></script>
<title>Testing</title>
<script>
(function() {
var instance = new StackAPI(
{
clientID : 5239,
key : "JPRwkkqAelchw)6d9S8wcw((",
authNeeded : true,
redirect_uri : "http://teamfreehugs.github.io/stackexchange/stackapi",
scope : [ "read_inbox" ]
});
var things = instance.authenticate();
if (things["access_token"] != undefined) {
alert('Your access token is '
+ things["access_token"]
+ ". "
+ (things["expires"] == null ? "" : "It expires in "
+ things["expires"] + " seconds. (IRK, weird.)"));
}
})();
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment