forked from nehoc/Custom-Twitter-PHP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
211 lines (192 loc) · 8.38 KB
/
demo.html
File metadata and controls
211 lines (192 loc) · 8.38 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Robin's Custom Twitter API: Test</title>
<style type="text/css">
table a:link {
color: #666;
font-weight: bold;
text-decoration:none;
}
table a:visited {
color: #999999;
font-weight:bold;
text-decoration:none;
}
table a:active,
table a:hover {
color: #bd5a35;
text-decoration:underline;
}
table {
font-family:Arial, Helvetica, sans-serif;
color:#666;
font-size:12px;
text-shadow: 1px 1px 0px #fff;
width: 900px;
margin: 0 auto;
background:#eaebec;
border:#ccc 1px solid;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
-moz-box-shadow: 0 1px 2px #d1d1d1;
-webkit-box-shadow: 0 1px 2px #d1d1d1;
box-shadow: 0 1px 2px #d1d1d1;
}
table th {
padding:21px 25px 22px 25px;
border-top:1px solid #fafafa;
border-bottom:1px solid #e0e0e0;
background: #ededed;
background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb));
background: -moz-linear-gradient(top, #ededed, #ebebeb);
}
table th:first-child {
text-align: left;
padding-left:20px;
}
table tr:first-child th:first-child {
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
border-top-left-radius:3px;
}
table tr:first-child th:last-child {
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
border-top-right-radius:3px;
}
table tr {
text-align: center;
padding-left:20px;
}
table td:first-child {
text-align: left;
padding-left:20px;
border-left: 0;
}
table td {
padding:18px;
border-top: 1px solid #ffffff;
border-bottom:1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
background: #fafafa;
background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
background: -moz-linear-gradient(top, #fbfbfb, #fafafa);
}
table tr.even td {
background: #f6f6f6;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6));
background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6);
}
table tr:last-child td {
border-bottom:0;
}
table tr:last-child td:first-child {
-moz-border-radius-bottomleft:3px;
-webkit-border-bottom-left-radius:3px;
border-bottom-left-radius:3px;
}
table tr:last-child td:last-child {
-moz-border-radius-bottomright:3px;
-webkit-border-bottom-right-radius:3px;
border-bottom-right-radius:3px;
}
table tr:hover td {
background: #f2f2f2;
background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0));
background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0);
}
</style>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
// Get the 5 latest tweets from user: thardesign
var username = "thardesign";
var tweets = "5";
$.get('./twitter_api.php?type=timeline&username=' + username + '&count=' + tweets, function (jsondata) {
// Parse JSON
var data = $.parseJSON(jsondata);
var i = 0;
// Append to content
$.each(data, function() {
i++;
$('#tweets-timeline').append('<tr><td>' + i + '</td><td>' + this['username'] + '</td><td>' + this['type'] + '</td><td><img src="' + this['avatar'] + '" /></td><td>' + this['date'] + '</td><td>' + this['tweet'] + '</td><tr>');
});
});
// Get the 5 most recent tweets with keyword: test
var keyword = "#test";
var searchtype = "recent";
var tweets = "5";
$.get('./twitter_api.php?type=search&searchtype=' + searchtype + '&q=' + encodeURIComponent(keyword) + '&count=' + tweets, function (jsondata) {
// Parse JSON
var data = $.parseJSON(jsondata);
var i = 0;
// Append to content
$.each(data, function() {
i++;
$('#tweets-search-recent').append('<tr><td>' + i + '</td><td>' + this['username'] + '</td><td>' + this['type'] + '</td><td><img src="' + this['avatar'] + '" /></td><td>' + this['date'] + '</td><td>' + this['tweet'] + '</td><tr>');
});
});
});
</script>
<body>
<table cellpadding="0" cellspacing="0">
<caption>
<br>
<h1>Twitter Custom PHP API</h1>
A Twitter timeline fetcher without using the Twitter 1.1 API. Compatible with the new Twitter layout.
<br><br>
Github Page: <a href="https://github.com/robinbonnes/Custom-Twitter-PHP-API">https://github.com/robinbonnes/Custom-Twitter-PHP-API</a>
<br>
Support me developing easy alternatives like this, by donating me a beer:
<br><br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCQUiTSkF2ym4KvyHyf5xVXm/swYOn//vRAYzJSUIfBUTB8YhgbNtdh0rE6wmjNboRC2GcOAeRYFkO9cjobL8ptC/26Jclll00ykNTHa94oqEM6RvbIFAAFUbOggMTFtP5CxQg3tFX2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1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMzA3MzAwMDIzMDVaMCMGCSqGSIb3DQEJBDEWBBR7jGm6Hie3KcajGdcQIym9ppbZ1TANBgkqhkiG9w0BAQEFAASBgKyxuBrmn/LQjU2hPtUEJcs88Ulsi4E0+170TOpLjXKKfwenYxslyuW/XD/bVH6dz24sCnrVbGfRWjz2QlFUHge9jVKzJzbAY53TXnXZLWOPt4b3RJKGurCHRJEMbEBoWvGtfsU8nDnKAd5yF4Cm4rTeZd33FFG0KIGz0y+qnpEf-----END PKCS7-----">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<br><br>
<h2>Latest 5 tweets from user: thardesign</h2>
<br>
</caption>
<thead>
<tr>
<th>#</th>
<th>Twitter Name</th>
<th>Tweet Type</th>
<th>Avatar</th>
<th>Date</th>
<th>Tweet</th>
</tr>
</thead>
<tbody id="tweets-timeline"></tbody>
</table>
<br>
<table cellpadding="0" cellspacing="0">
<caption>
<br>
<h2>The 5 most relevant tweets with keyword: test</h2>
<br>
</caption>
<caption style="caption-side:bottom;">
<br><br>
Copyright 2013 Robin Bonnes under the <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution License</a>.
<br><br>
</caption>
<thead>
<tr>
<th>#</th>
<th>Twitter Name</th>
<th>Tweet Type</th>
<th>Avatar</th>
<th>Date</th>
<th>Tweet</th>
</tr>
</thead>
<tbody id="tweets-search-recent"></tbody>
</table>
</body>
</html>