-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
334 lines (245 loc) · 7.75 KB
/
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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
<!--
body { font: 100%/1.5 Arial sans-serif; }
#container { margin: 0 10px; }
h1 { margin-bottom: 0; }
h2 { margin-top: 0; }
pre {
font: .75em/1.5 Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
color: #333;
border: 1px solid rgba(0, 0, 0, .15);
background: rgba(0, 0, 0, .1);
margin: 0 0 10px;
padding: 5px 10px;
word-wrap: normal;
overflow: auto;
white-space: pre;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
iframe[id^='twitter-widget-'],
.twitter-timeline { width: 100%; }
-->
</style>
</head>
<body>
<div id="container">
<h1>Twitter "timeline" widget examples</h1>
<p>Check out <a href="https://github.com/registerguard/registerguard.github.com/wiki/Twitter-timeline-widget-guide">this WIKI page</a> for more information.</p>
<hr>
<section>
<hgroup>
<h1>Out-of-the-box Twitter widget</h1>
<h2>Tweets by <a href="https://twitter.com/registerguard">@registerguard</a></h2>
</hgroup>
<p>The default markup, below, will display the user timeline of <a href="https://twitter.com/registerguard">@registerguard</a> by default.</p>
<a
class="twitter-timeline"
href="https://twitter.com/registerguard"
data-widget-id="347149624567558145"
>
Tweets by @registerguard
</a>
<p>Copy/paste friendly:</p>
<pre>
<a
class="twitter-timeline"
href="https://twitter.com/registerguard"
data-widget-id="347149624567558145"
>
Tweets by @registerguard
</a>
</pre>
<p>This markup can be used for all other users and widget categories except for "search" (see below).</p>
</section>
<hr>
<section>
<hgroup>
<h1>Modification #1: User</h1>
<h2>Tweets by <a href="https://twitter.com/rgsports">@rgsports</a></h2>
</hgroup>
<p>In this example, I've added the attributes <code>data-screen-name="rgsports"</code> to override the default (above).</p>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports"
data-widget-id="347149624567558145"
data-screen-name="rgsports"
width="100%"
>
Tweets by @rgsports
</a>
<p>Copy/paste friendly:</p>
<pre>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports"
data-widget-id="347149624567558145"
data-screen-name="rgsports"
width="100%"
>
Tweets by @rgsports
</a>
</pre>
</section>
<hr>
<section>
<hgroup>
<h1>Modification #2: Favorites</h1>
<h2>Favorite Tweets by <a href="https://twitter.com/rgsports/favorites">@rgsports</a></h2>
</hgroup>
<p>In this example, I've added the attribute <code>data-favorites-screen-name="rgsports"</code> to override the default (above).</p>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports/favorites"
data-widget-id="347149624567558145"
data-favorites-screen-name="rgsports"
width="100%"
>
Favorite Tweets by @rgsports
</a>
<p>Copy/paste friendly:</p>
<pre>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports/favorites"
data-widget-id="347149624567558145"
data-favorites-screen-name="rgsports"
width="100%"
>
Favorite Tweets by @rgsports
</a>
</pre>
</section>
<hr>
<section>
<hgroup>
<h1>Modification #3: List</h1>
<h2>Tweets from <a href="https://twitter.com/rgsports/rg-sports-dept">@rgsports/rg-sports-dept</a></h2>
</hgroup>
<p>In this example, I've added the attributes <code>data-list-owner-screen-name="rgsports"</code> and <code>data-list-slug="rg-sports-dept"</code> to override the default (above).</p>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports/lists/rg-sports-dept"
data-widget-id="347149624567558145"
data-list-owner-screen-name="rgsports"
data-list-slug="rg-sports-dept"
width="100%"
>
Tweets from @rgsports/rg-sports-dept
</a>
<p>Copy/paste friendly:</p>
<pre>
<a
class="twitter-timeline"
href="https://twitter.com/rgsports/rg-sports-dept"
data-widget-id="347149624567558145"
data-list-owner-screen-name="rgsports"
data-list-slug="rg-sports-dept"
width="100%"
>
Tweets from @rgsports/rg-sports-dept
</a>
</pre>
</section>
<hr>
<section>
<h1>Search</h1>
<p>Unfortunately, the Twitter docs state: "At the present time, it is not possible to override search queries." <b>Translation</b>: You have to <a href="https://twitter.com/settings/widgets">create a new widget</a> every time you want to embed a new "search" widget onto your pages.</p>
<p>In the example below, I'm searching for the keyword "registerguard".</p>
<a
class="twitter-timeline"
href="https://twitter.com/search?q=%23registerguard"
data-widget-id="347514528235397122"
>
Tweets about "#registerguard"
</a>
<p>Copy/paste friendly:</p>
<pre>
<a
class="twitter-timeline"
href="https://twitter.com/search?q=%23registerguard"
data-widget-id="347514528235397122"
>
Tweets about "#registerguard"
</a>
</pre>
<p>While it's unfortunate that you can't re-use the "default" markup for searches, probably the most important thing to keep in mind is that you don't need the Javascript that's generated when <a href="https://twitter.com/settings/widgets">creating a new widget</a>.</p>
</section>
</div> <!-- /#container -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
<!--
/**
* Twitter timeline widget JS.
*
* @see https://twitter.com/settings/widgets/
* @see https://dev.twitter.com/docs/embedded-timelines
* @see http://stackoverflow.com/a/5654929/922323
* @see http://tappetyclick.com/blog/2012/12/20/how-dynamically-resize-new-twitter-widget
* @see https://www.geekgoddess.com/change-twitter-widget-to-wider-than-520px
*/
$(document).ready(function() {
!function(id) {
if ($('.twitter-timeline').length && ( ! $('#' + id).length)) {
$('<script>', {
'id' : id,
'src' : '//platform.twitter.com/widgets.js'
})
.appendTo('head');
}
}('twitter-wjs');
});
/*
$(document).ready(function() {
!function(id) {
if ($('.twitter-timeline').length && ( ! $('#' + id).length)) {
$('<script>')
.appendTo('head')
.attr('id', id)
.attr('src', '//platform.twitter.com/widgets.js');
}
}('twitter-wjs');
});
*/
/*
$(document).ready(function() {
!function(document, id) {
var js;
if ($('.twitter-timeline').length && ( ! $('#' + id).length)) {
js = document.createElement('script');
js.id = id;
js.src = '//platform.twitter.com/widgets.js';
$('head').append(js);
}
}(document, 'twitter-wjs');
});
*/
/*
!function(document, el, id) {
// Hoisted variables:
var js,
fjs;
if ( ! document.getElementById(id)) {
fjs = document.getElementsByTagName(el)[0];
js = document.createElement(el);
js.id = id;
js.src = (/^http:/.test(document.location) ? 'http' : 'https') + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');
*/
/*
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
*/
//-->
</script>
</body>