-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
34 lines (31 loc) · 842 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html />
<html>
<head>
<title>API proxy demo</title>
<style>
#tweets {
margin: 0 auto;
width: 300px;
}
</style>
</head>
<body>
<div id="tweets">
<a href="http://twitter.com/Encosia" target="_blank">Follow my updates on Twitter</a>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script>
$.getJSON('TwitterProxy.ashx', { id: 'Encosia' }, function(tweets) {
displayTweets(tweets);
});
function displayTweets(tweets) {
for (var i = 0; i < tweets.length; i++) {
var tweet = tweets[i];
// Only display the tweets that aren't @replies.
if (tweet.in_reply_to_user_id == null)
$('#tweets').append('<p>' + tweet.text + '</p>');
}
}
</script>
</body>
</html>