-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtwitter search.html
More file actions
46 lines (30 loc) · 1.09 KB
/
twitter search.html
File metadata and controls
46 lines (30 loc) · 1.09 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$.getJSON("http://cooper-union-search-proxy.herokuapp.com/twitter/search/cooper%20union?count=100", function(response){
console.log("There are " + response.statuses.length + " tweets");
for(var i=0; i<response.statuses.length; i++) {
// console.log(response.statuses[i].text);
var retweet_count = response.statuses[i].retweet_count;
var favorite_count = response.statuses[i].favorite_count;
if(retweet_count > 0) {
// console.log("This tweet was retweeted!");
}
if(favorite_count > 0) {
// console.log("This tweet was favorited!");
}
if((retweet_count > 0) && (favorite_count>0)) {
$("body").append("<h1>"+response.statuses[i].text+"</h1>");
} else {
console.log("boring tweet " + response.statuses[i].text);
}
}
});
</script>
</head>
<body>
<div id="temperature"></div>
</body>
</html>