-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtweets.php
72 lines (44 loc) · 1.15 KB
/
tweets.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
<script>
//http://search.twitter.com/search.json?q=obama%20-romney%20%3A%28&page=100&result_type=recent&rpp=100&until=2012-10-09
$.ajax({
url: 'http://search.twitter.com/search.json?q=obama%20-romney%20%3A%28&page=1&result_type=recent&rpp=100&until=2012-10-19&include_entities=true',
dataType:'jsonp',
success:function(response){
$.each(response.results, function(i, tweet){
console.log(response);
var text = tweet['text'];
$('#tweets').append('<div class="tweet"><li class="show">' + text + '</li></div>');
$("<li></li>").hover(function(){
$(this).css('background', 'blue');
});
});
},
error: function(){
console.log("damn. i'm sad");
}
});
</script>
</head>
<style>
.tweet {
width:30px;
height:1px;
background-color:lightgreen;
}
.tweet:hover{
background-color:green;
}
.tweet li{
display:none;
margin-left:60px;
width:400px;
}
</style>
<body>
<ul id="tweets"></ul>
</body>
</html>