Skip to content

Instantly share code, notes, and snippets.

@johnkoht
Created January 15, 2012 00:51
Show Gist options
  • Save johnkoht/1613646 to your computer and use it in GitHub Desktop.
Save johnkoht/1613646 to your computer and use it in GitHub Desktop.
Oi'vangelist API
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="language" content="en" />
<title>kohactive | a creative digital company</title>
<meta name="robots" content="noindex,nofollow " />
<meta name="googlebot" content="noindex " />
<meta name="revisit-after" content="never" />
<link rel="apple-touch-icon" type="image/x-icon" href="http://c475109.r9.cf2.rackcdn.com/kohv3/favicon.png" />
<link rel="icon" type="image/x-icon" href="http://c475109.r9.cf2.rackcdn.com/kohv3/favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="http://c475109.r9.cf2.rackcdn.com/kohv3/favicon.png" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="results_container">
<h1>Check your console</h1>
</div>
<!-- this is where the oivangelist's will be loaded -->
<div id="results2" style="position:relative; left:590px; width:300px; color:#FFFFFF; top:45px; z-index: 99999;">
</div>
<script type="text/javascript">
$.ajax({
type : 'GET',
url : 'http://twitvangelist.kohsrv.net/leaderboard/combined.json', // this will give you the combined tweets and leaderboard
dataType : 'JSONP',
jsonpCallback : 'callbackfunction',
success : function(results) {
console.log(results.top3); // this will give you the top 3 from the leaderboard
console.log(results.tweets); // this will give you the a list of tweets with the hashtag
var top3 = results.top3;
$.each(top3, function(item) {
console.log(top3[item].user_pic);
$('#results2').append('<img src="'+top3[item].user_pic+'" /><span>'+top3[item].twitter_handle+'</span>');
});
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment