Skip to content

Instantly share code, notes, and snippets.

@phlipper
Created December 14, 2011 00:03
Show Gist options
  • Save phlipper/1474558 to your computer and use it in GitHub Desktop.
Save phlipper/1474558 to your computer and use it in GitHub Desktop.
a quick demo of how to use the twitter json info
<!DOCTYPE html>
<html>
<head>
<title>JS Test</title>
</head>
<body id="" onload="">
<div id="results"></div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
var jsonUrl = "http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls=www.kidsruby.com&format=json&callback=?";
$.getJSON(jsonUrl, function(data) {
$("#results").html("Like Count: " + data[0].like_count);
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>JS Test</title>
</head>
<body id="" onload="">
<div id="results"></div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
var jsonUrl = "http://urls.api.twitter.com/1/urls/count.json?url=www.kidsruby.com&callback=?";
$.getJSON(jsonUrl, function(data) {
$("#results").html("Followers: " + data.count);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment