-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
609 lines (580 loc) · 27.9 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Feed the Fire: RSS2Firebase</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="https://netdna.bootstrapcdn.com/bootswatch/2.3.1/readable/bootstrap.min.css" rel="stylesheet">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<link href="static/jackedup.css" rel="stylesheet">
<link href="static/solarized_light.css" rel="stylesheet">
<script src="https://cdn.firebase.com/v0/firebase.js"></script>
<script src="https://cdn.firebase.com/v0/firebase-auth-client.js"></script>
<style>
.container {
display: none;
margin-top: 50px;
}
.userbox {
float: right;
text-align: right;
}
form {
margin-top: 20px;
}
#expander {
cursor: pointer;
text-decoration: none;
}
#default-feed-list {
display: none;
}
</style>
</head>
<body class="preview" id="top">
<a target="_blank" href="https://github.com/firebase/feedthefire"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png" alt="Fork me on GitHub"></a>
<div class="container" id="content">
<div></div>
<hr>
<footer id="footer">
<a target="_blank" href="https://www.firebase.com/?utm_source=bottomlogo&utm_medium=email&utm_campaign=feedthefire">
<img style="float:right;" src="http://www.firepad.io/images/powered-by-firebase-dim.png">
</a>
<a href="http://github.com/firebase/feedthefire" target="_blank">Feed the Fire</a> is
licensed under the <a href="http://firebase.mit-license.org" target="_blank">MIT License</a>.
Popular feed list courtesy of <a href="http://www.newsblur.com/" target="_blank">NewsBlur</a>.
<br/>
Bootstrap theme from <a href="http://bootswatch.com/" target="_blank">Bootswatch</a>.<br/>
</footer>
<br>
</div>
<script type="text/template" id="front-page">
<header class="jumbotron subhead" id="overview">
<img style="float:right;width:300px;" src="static/feedthefire.png"/>
<div class="row">
<div class="span6">
<h1>Feed the Fire</h1>
<p class="lead">Stream RSS & Atom feeds into
<a target="_blank"
href="https://www.firebase.com/?utm_source=toplogo&utm_medium=email&utm_campaign=feedthefire">Firebase</a>.
</p>
</div>
</div>
</header>
<section>
<p>
<a id="login" href="#"><img src="static/sign_in.png"/></a>
to set up your own subscriptions ‐ <b>OR</b> ‐
</p>
<p>
Directly consume some of the most popular feeds from a public Firebase in just a few lines of code:
</p>
<div class="row-fluid">
<div class="span8">
<pre><code style="font-size:13px;" id="home-example" class="language-javascript"></code></pre>
</div>
<div class="span1" style="padding-top:110px;font-size:175px;">}</div>
<div class="span3" style="padding-top:30px;padding-left:10px;">
<h4 id="e-title"></h5>
<ul id="e-list"></ul>
</div>
</div>
<p>
<a id="expander">
Full list of public feeds available
<img id="expander"
src="https://www.firebase.com/forge/images/expand_data.png"
data-alt="https://www.firebase.com/forge/images/collapse_data.png"/>
</a>
</p>
<div id="default-feed-list">
<table class="table table-bordered">
<thead>
<tr>
<td><b>Name</b></td>
<td><b>Firebase URL</b></td>
<td><b>Copy</b></td>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://xkcd.com/rss.xml" target="_blank">xkcd.com</a></td>
<td><code>https://feeds.firebaseio.com/xkcd</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/xkcd" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/TechCrunch" target="_blank">TechCrunch</a></td>
<td><code>https://feeds.firebaseio.com/techcrunch</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/techcrunch" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.gawker.com/gizmodo/full" target="_blank">Gizmodo</a></td>
<td><code>https://feeds.firebaseio.com/gizmodo</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/gizmodo" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.arstechnica.com/arstechnica/index/" target="_blank">Ars Technica</a></td>
<td><code>https://feeds.firebaseio.com/ars</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/ars" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.gawker.com/lifehacker/full" target="_blank">Lifehacker</a></td>
<td><code>https://feeds.firebaseio.com/lifehacker</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/lifehacker" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://blog.newsblur.com/rss" target="_blank">The NewsBlur Blog</a></td>
<td><code>https://feeds.firebaseio.com/newsblur</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/newsblur" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/blogspot/MKuf" target="_blank">The Official Google Blog</a></td>
<td><code>https://feeds.firebaseio.com/google</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/google" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://rss.slashdot.org/Slashdot/slashdot" target="_blank">Slashdot</a></td>
<td><code>https://feeds.firebaseio.com/slashdot</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/slashdot" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://daringfireball.net/index.xml" target="_blank">Daring Fireball</a></td>
<td><code>https://feeds.firebaseio.com/fireball</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/fireball" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.engadget.com/rss.xml" target="_blank">Engadget RSS Feed</a></td>
<td><code>https://feeds.firebaseio.com/engadget</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/engadget" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.wired.com/wired/index" target="_blank">Wired Top Stories</a></td>
<td><code>https://feeds.firebaseio.com/wired</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/wired" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/boingboing/iBag" target="_blank">Boing Boing</a></td>
<td><code>https://feeds.firebaseio.com/boing</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/boing" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.boston.com/boston/bigpicture/index" target="_blank">The Big Picture</a></td>
<td><code>https://feeds.firebaseio.com/bigpicture</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/bigpicture" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/oatmealfeed" target="_blank">The Oatmeal</a></td>
<td><code>https://feeds.firebaseio.com/oatmeal</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/oatmeal" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/codinghorror/" target="_blank">Coding Horror</a></td>
<td><code>https://feeds.firebaseio.com/codinghorror</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/codinghorror" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.kottke.org/main" target="_blank">kottke.org</a></td>
<td><code>https://feeds.firebaseio.com/kottke</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/kottke" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/smbc-comics/PvLb" target="_blank">Saturday Morning Breakfast Cereal</a></td>
<td><code>https://feeds.firebaseio.com/smbc</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/smbc" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://rss1.smashingmagazine.com/feed/" target="_blank">Smashing Magazine Feed</a></td>
<td><code>https://feeds.firebaseio.com/smashing</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/smashing" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.tuaw.com/rss.xml" target="_blank">The Unofficial Apple Weblog</a></td>
<td><code>https://feeds.firebaseio.com/tuaw</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/tuaw" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/OfficialGmailBlog" target="_blank">Gmail Blog</a></td>
<td><code>https://feeds.firebaseio.com/gmail</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/gmail" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.macrumors.com/MacRumors-All" target="_blank">MacRumors: Mac News and Rumors</a></td>
<td><code>https://feeds.firebaseio.com/macrumors</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/macrumors" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/makezineonline" target="_blank">MAKE</a></td>
<td><code>https://feeds.firebaseio.com/make</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/make" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.joelonsoftware.com/rss.xml" target="_blank">Joel on Software</a></td>
<td><code>https://feeds.firebaseio.com/joel</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/joel" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/blogspot/dtKx" target="_blank">Official Google Reader Blog</a></td>
<td><code>https://feeds.firebaseio.com/reader</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/reader" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/DilbertDailyStrip" target="_blank">Dilbert Daily Strip</a></td>
<td><code>https://feeds.firebaseio.com/dilbert</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/dilbert" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://rss.nytimes.com/services/xml/rss/nyt/US.xml" target="_blank">NYT > U.S.</a></td>
<td><code>https://feeds.firebaseio.com/nyt</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/nyt" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.bbci.co.uk/news/rss.xml?edition=int" target="_blank">BBC News</a></td>
<td><code>https://feeds.firebaseio.com/bbc</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/bbc" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/failblog" target="_blank">FAIL Blog</a></td>
<td><code>https://feeds.firebaseio.com/failblog</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/failblog" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/alistapart/main" target="_blank">A List Apart</a></td>
<td><code>https://feeds.firebaseio.com/alistapart</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/alistapart" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/marcoorg" target="_blank">Marco.org</a></td>
<td><code>https://feeds.firebaseio.com/marco</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/marco" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.theverge.com/rss/index.xml" target="_blank">The Verge</a></td>
<td><code>https://feeds.firebaseio.com/verge</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/verge" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://zenhabits.net/feed/" target="_blank">zenhabits</a></td>
<td><code>https://feeds.firebaseio.com/zenhabits</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/zenhabits" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://syndication.thedailywtf.com/TheDailyWtf" target="_blank">The Daily WTF</a></td>
<td><code>https://feeds.firebaseio.com/dailywtf</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/dailywtf" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/typepad/sethsmainblog" target="_blank">Seth Godin</a></td>
<td><code>https://feeds.firebaseio.com/seth</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/seth" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.penny-arcade.com/pa-mainsite" target="_blank">Penny Arcade</a></td>
<td><code>https://feeds.firebaseio.com/penny</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/penny" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://what-if.xkcd.com/feed.atom" target="_blank">What If?</a></td>
<td><code>https://feeds.firebaseio.com/whatif</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/whatif" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/readwriteweb" target="_blank">ReadWriteWeb</a></td>
<td><code>https://feeds.firebaseio.com/readwrite</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/readwrite" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.questionablecontent.net/QCRSS.xml" target="_blank">Questionable Content</a></td>
<td><code>https://feeds.firebaseio.com/qc</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/qc" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://kk.org/cooltools/feed" target="_blank">Cool Tools</a></td>
<td><code>https://feeds.firebaseio.com/cooltools</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/cooltools" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/GoogleOperatingSystem" target="_blank">Google Operating System</a></td>
<td><code>https://feeds.firebaseio.com/googleos</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/googleos" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/smittenkitchen" target="_blank">smitten kitchen</a></td>
<td><code>https://feeds.firebaseio.com/smitten</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/smitten" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://rss.cnn.com/rss/cnn_topstories.rss" target="_blank">CNN.com</a></td>
<td><code>https://feeds.firebaseio.com/cnn</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/cnn" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="https://news.ycombinator.com/rss" target="_blank">Hacker News</a></td>
<td><code>https://feeds.firebaseio.com/hn</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/hn" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://www.randsinrepose.com/index.xml" target="_blank">Rands In Repose</a></td>
<td><code>https://feeds.firebaseio.com/rands</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/rands" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://waxy.org/index.xml" target="_blank">Waxy.org</a></td>
<td><code>https://feeds.firebaseio.com/waxy</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/waxy" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/venturebeat" target="_blank">VentureBeat</a></td>
<td><code>https://feeds.firebaseio.com/venturebeat</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/venturebeat" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/apartmenttherapy/main" target="_blank">Apartment Therapy</a></td>
<td><code>https://feeds.firebaseio.com/apartment</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/apartment" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/Hyperbole-and-a-half" target="_blank">Hyperbole and a Half</a></td>
<td><code>https://feeds.firebaseio.com/hyperbole</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/hyperbole" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/ommalik" target="_blank">GigaOM</a></td>
<td><code>https://feeds.firebaseio.com/gigaom</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/gigaom" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
<tr>
<td><a href="http://feeds.feedburner.com/schneier/fulltext" target="_blank">Schneier on Security</a></td>
<td><code>https://feeds.firebaseio.com/schneier</code></td>
<td><a data-clipboard-text="https://feeds.firebaseio.com/schneier" class="btn clipboard"><i class="icon-pencil"></i></a></td>
</tr>
</tbody>
</table>
</div>
</section>
</script>
<script type="text/template" id="user-page">
<section id="tables">
<div class="userbox">
<%= email %><br/>
<a href="#" id="logout" class="btn btn-small">Logout</a>
</div>
<div class="page-header">
<h1>Feed the Fire</h1>
</div>
<form id="add-feed" class="form-horizontal well">
<fieldset>
<div class="control-group">
<label class="control-label" for="feedURL">Feed URL</label>
<div class="controls">
<input required
type="text" class="input-xlarge" id="feedURL"
placeholder="http://example.org/feed.atom"
data-validation-required-message="The Feed URL is required.">
<p class="help-block">A URL to any valid RSS or Atom feed you want to source data from.</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="fbURL">Firebase URL</label>
<div class="controls">
<input required
type="text" class="input-xlarge" id="fbURL"
placeholder="https://example.firebaseio.com/"
data-validation-required-message="The Firebase URL is required.">
<p class="help-block">The URL to the Firebase in which you want feed items to appear.</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="secret">Firebase Secret</label>
<div class="controls">
<input type="text" class="input-xlarge" id="secret" placeholder="d10443518ea849759570411280a15dba">
<p class="help-block">If you have implemented security rules to prevent anonymous writes to your Firebase,
you may provide a secret.</p>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Add Feed</button>
<button type="reset" class="btn">Cancel</button>
</div>
</fieldset>
</form>
<div id="feedArea">
<p>You have no active feeds, try adding one!</p>
</div>
</section>
</script>
<script type="text/template" id="list-feeds">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Feed URL</th>
<th>Firebase URL</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</script>
<script type="text/template" id="list-item">
<td><code><%= url %></code></td>
<td><code><%= firebase %></code></td>
<td class="status"><%= status %></td>
<td>
<a style="float:right;" class="btn btn-small btn-danger" href="javascript:removeFeed('<%= id %>');">
<i class="icon-remove icon-white"></i>
</a>
</td>
</script>
<script type="text/template" id="example-script">var ref = new Firebase("https://feeds.firebaseio.com/xkcd");
ref.child("meta").once("value", function(snapshot) {
$("#e-title").html(snapshot.val().description);
});
ref.child("articles").limit(3).on("child_added", function(snapshot) {
var article = snapshot.val();
var link = $("<a>", {"href": article.link, "target": "_blank"});
$("#e-list").append($("<li>").append(link.html(article.title)));
});
</script>
<script src="https://login.persona.org/include.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/humane-js/3.0.6/humane.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.1.7/ZeroClipboard.min.js"></script>
<script type="text/javascript">
var __num = 0;
var __URL = "https://feedthefire.firebaseio.com";
humane.error = humane.spawn({addnCls: "humane-jackedup-error"});
var ref = new Firebase(__URL);
var userRef = null;
var authClient = new FirebaseAuthClient(ref, function(err, user) {
if (err) {
humane.error(err.message);
} else if (user) {
userRef = new Firebase(__URL).child(user.provider).child(user.id);
loadUserPage(user);
} else {
loadFrontPage();
}
});
(function setupClipboard() {
ZeroClipboard.setDefaults({moviePath: "static/zeroclipboard.swf"});
var clip = new ZeroClipboard($(".clipboard"));
clip.on("complete", function(cl, arg) {
humane.log("Copied <code>" + arg.text + "</code> to clipboard!");
});
})();
function transition(id, content, next) {
$("#content").fadeOut("fast", function() {
$("#content div").html(_.template($(id).html(), content));
$("#content").fadeIn("slow", next);
});
}
function loadFrontPage() {
$("#logout").off("click");
transition("#front-page", null, function() {
$("#expander").click(function(e) {
e.preventDefault();
var img = $("#expander img");
var link = img.data("alt");
img.data("alt", img.attr("src"));
img.attr("src", link);
$("#default-feed-list").slideToggle();
});
var code = $("#example-script").html();
$("#home-example").html(_.escape($("#example-script").html()));
$("pre code").each(function(i, e) { hljs.highlightBlock(e); });
eval(code);
$("#login").click(function() {
authClient.login("persona");
});
});
}
function loadUserPage(user) {
$("#login").off("click");
$("#expander").off("click");
transition("#user-page", user, function() {
setupHandlers();
$("#add-feed").submit(function(e) {
e.preventDefault();
var el = $("#add-feed .form-actions > button[type=submit]");
el.attr("disabled", "disabled");
addFeed(user, function() {
$("#add-feed")[0].reset();
el.removeAttr("disabled");
});
});
$("#logout").click(function() {
cleanupHandlers();
authClient.logout();
});
});
}
function getRow(id, item) {
return _.template($("#list-item").html(), {
id: id,
url: item.url,
firebase: item.firebase,
status: "<i>Processing...</i>"
});
}
function setupHandlers() {
var feedRef = userRef.child("feeds");
feedRef.on("child_added", function(snap) {
var id = snap.name();
var row = getRow(id, snap.val());
if (__num == 0) {
$("#feedArea").html($("#list-feeds").html());
}
$("#feedArea tbody").append($("<tr id=" + id + ">").html(row));
__num++;
});
feedRef.on("child_removed", function(snap) {
$("#" + snap.name()).remove();
__num--;
if (__num == 0) {
$("#feedArea").html("<p>You have no active feeds, try adding one!</p>");
}
});
feedRef.on("child_changed", function(snap) {
var id = snap.name();
var row = getRow(id, snap.val());
$("#" + id).html(row);
});
var statusRef = userRef.child("status");
statusRef.on("child_added", updateStatus);
statusRef.on("child_changed", updateStatus);
}
function cleanupHandlers() {
__num = 0;
userRef.child("feeds").off();
userRef.child("status").off();
}
function updateStatus(snap) {
var id = snap.name();
var status = snap.val();
if (status.indexOf("Last Sync") == 0) {
var times = status.split(":");
times.shift();
status = "Last Sync at " + new Date(times.join(":").trim());
}
$("#" + id + " .status").html(status);
}
function removeFeed(id) {
userRef.child("feeds").child(id).remove();
}
function addFeed(user, done) {
userRef.child("feeds").push({
url: $("#feedURL").val(),
firebase: $("#fbURL").val(),
secret: $("#secret").val()
}, done);
}
</script>
</body>
</html>