-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.opml
More file actions
1271 lines (1269 loc) · 80 KB
/
source.opml
File metadata and controls
1271 lines (1269 loc) · 80 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
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
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- OPML generated by OPML Editor v10.1b19 on Tue, 11 Nov 2025 13:50:49 GMT -->
<!--
Hi this is Dave Winer. I write all my project code in an outliner, which
generates all the files that make up this GitHub project. You'll see a
source.opml file like this in each of my projects. It contains the outline
source that the repo files were generated from. This is the most logical place
to store them. You can read the code in any outliner that supports OPML, which
includes https://drummer.land. You can use the Open URL command in
Drummer's File menu to open the "raw" version of this file straight from the
GitHub repo.
-->
<opml version="2.0">
<head>
<title>nodeEditor: daverss</title>
<dateCreated>Tue, 16 May 2017 17:55:14 GMT</dateCreated>
<dateModified>Tue, 11 Nov 2025 13:50:49 GMT</dateModified>
<ownerName>Dave Winer</ownerName>
<ownerId>http://davewiner.com/</ownerId>
<expansionState>1, 2, 3, 24, 25, 34, 43, 74, 78, 97, 98, 128</expansionState>
<vertScrollState>1</vertScrollState>
<windowTop>118</windowTop>
<windowLeft>775</windowLeft>
<windowBottom>1130</windowBottom>
<windowRight>2113</windowRight>
</head>
<body>
<outline text="/scripting.com/code/daverss/">
<outline text="worknotes.md" created="Tue, 21 Mar 2023 13:47:43 GMT">
<outline text="#### 11/10/25; 11:09:22 AM by DW" created="Mon, 10 Nov 2025 16:09:21 GMT">
<outline text="Support source:markdown." created="Mon, 10 Nov 2025 16:09:22 GMT"/>
<outline text="When building a feed, if there's headElement.flSourceMarkdown and it's true, and there is a text value for the item, we generate a source:markdown element by calling turndown to convert it. " created="Mon, 10 Nov 2025 16:29:40 GMT"/>
<outline text="Note, there was previous source:markdown support dating back to 2022, which looked for item.markdowntext. It's good in case the feed is being generated for an editor where the user wrote in markdown, it's not being generated. " created="Mon, 10 Nov 2025 16:30:59 GMT"/>
<outline text="In package.json, the version of turndown is 7.2.2. Learned the lesson many times the hard way to always require the version of a package that you used to implement the functionality and not to use "*" because developers implement breaking changes in the most trivial packages (not that turndown is trivial but it may include them). " created="Tue, 11 Nov 2025 13:49:18 GMT"/>
</outline>
<outline text="#### 6/4/25; 11:02:52 AM by DW" created="Wed, 04 Jun 2025 15:02:51 GMT">
<outline text="When building the <image> element, we were adding the description twice. Fixed." created="Wed, 04 Jun 2025 15:02:52 GMT"/>
</outline>
<outline text="#### 12/4/24; 10:54:13 AM by DW" created="Wed, 04 Dec 2024 15:54:13 GMT">
<outline text="Added support for <webmaster>." created="Wed, 04 Dec 2024 15:54:13 GMT"/>
</outline>
<outline text="#### 6/17/24; 5:49:33 PM by DW" created="Mon, 17 Jun 2024 21:49:30 GMT">
<outline text="Add support for <itunes:author> and <itunes:type>." created="Mon, 17 Jun 2024 18:30:16 GMT"/>
</outline>
<outline text="#### 5/20/24; 5:00:37 PM by DW" created="Mon, 20 May 2024 21:00:36 GMT">
<outline text="Add support for <source:self>." created="Mon, 20 May 2024 21:00:37 GMT"/>
</outline>
<outline text="#### 3/14/24; 1:23:03 PM by DW" created="Thu, 14 Mar 2024 17:23:03 GMT">
<outline text="Support for <source:blogroll> element." created="Tue, 28 Nov 2023 17:36:40 GMT"/>
</outline>
<outline text="#### 4/4/23; 10:05:50 AM by DW" created="Tue, 04 Apr 2023 14:05:50 GMT">
<outline text="Stopped generating a <source:outline> element for enclosures that are images. " created="Tue, 04 Apr 2023 14:05:51 GMT"/>
</outline>
<outline text="#### 3/21/23; 9:48:11 AM by DW" created="Tue, 21 Mar 2023 13:48:09 GMT">
<outline text="Allow for source:account elements for items that are not twitter identifiers." created="Tue, 21 Mar 2023 13:48:20 GMT"/>
</outline>
<outline text="#### 12/29/21; 9:16:55 AM by DW" created="Wed, 29 Dec 2021 14:16:55 GMT">
<outline text="Changed the value of rssCloudDefaults.path to /ping. Andrew Shell posted an issue saying that the path previously specified there was incorrect. Andrew operates the server, so is the authority on this. " created="Wed, 29 Dec 2021 14:16:56 GMT"/>
</outline>
<outline text="#### 7/31/19; 11:00:42 AM by DW">
<outline text="Add support for <author> sub-element of item."/>
</outline>
<outline text="#### 5/16/19; 12:46:50 PM by DW">
<outline text="Don't write out a subs att for source:outline elements. "/>
</outline>
<outline text="#### 12/18/18; 10:19:04 AM by DW">
<outline text="support source:account for items"/>
<outline text="support category element">
<outline text="must provide an array called categories"/>
<outline text="each item in the array is a category"/>
</outline>
</outline>
<outline text="#### 7/4/17; 12:39:05 PM by DW">
<outline text="Bring in support for Facebook Instant Articles feeds. "/>
</outline>
<outline text="#### 6/28/17; 10:25:32 AM by DW">
<outline text="In buildOutlineXml we only looked for four atts: type, text, created and name. But there are other types. I don't see any notes explaining why we were only exporting these. So I've changed it to export all atts that are present. "/>
</outline>
<outline text="#### 6/9/17; 7:45:09 AM by DW">
<outline text="Per Dan MacTough's suggestion, in the JSON version, the length attribute on enclosure should be a number. If it coerces to a number, great, if there's an error, leave out the length att. "/>
</outline>
<outline text="#### 5/28/17; 2:00:55 PM by DW">
<outline text="Forked from buildrss.js in libraries. There was lots of buggy cruft in here, I wanted to fix stuff, but without taking chances on breaking basically frozen apps like Radio3, LCE."/>
<outline text="Removed rssCloudPing."/>
</outline>
<outline text="#### 3/8/17; 4:24:13 PM by DW">
<outline text="Copied rssCloudPing from Radio3. I didn't want to copy the code into ElectricPork."/>
<outline text="Use rssCloudDefaults in producing your RSS feed. If you don't specify a server URL in the call to rssCloudPing, we'll use what's in rssCloudDefaults to form the URL."/>
</outline>
</outline>
<outline text="package.json">
<outline text="{">
<outline text=""name": "daverss","/>
<outline text=""description": "This is where I put my code to generate RSS feeds from server apps.","/>
<outline text=""author": "Dave Winer <dave.winer@gmaill.com>","/>
<outline text=""license": "MIT","/>
<outline text=""version": "0.6.12","/>
<outline text=""main": "daverss.js","/>
<outline text=""repository": {">
<outline text=""type": "git","/>
<outline text=""url": "https://github.com/scripting/rss.git""/>
<outline text="},"/>
</outline>
<outline text=""files": [">
<outline text=""daverss.js""/>
<outline text="],"/>
</outline>
<outline text=""dependencies": {">
<outline text=""dateformat": "4.5.1","/>
<outline text=""marked": "3.0.8","/>
<outline text=""turndown": "7.2.2"," created="Mon, 10 Nov 2025 16:34:45 GMT"/>
<outline text=""turndown": "*"," isComment="true" created="Mon, 10 Nov 2025 16:34:45 GMT"/>
<outline text=""querystring": "*","/>
<outline text=""daveutils": "*""/>
<outline text="} "/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="daverss.js">
<outline text="var myProductName = "daverss", myVersion = "0.6.12"; " created="Mon, 03 Feb 2014 03:21:03 GMT" pgfnum="36831"/>
<outline text=""/>
<outline text="/* The MIT License (MIT)">
<outline text="Copyright (c) 2014-2021 Dave Winer"/>
<outline text=""/>
<outline text="Permission is hereby granted, free of charge, to any person obtaining a copy"/>
<outline text="of this software and associated documentation files (the "Software"), to deal"/>
<outline text="in the Software without restriction, including without limitation the rights"/>
<outline text="to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"/>
<outline text="copies of the Software, and to permit persons to whom the Software is"/>
<outline text="furnished to do so, subject to the following conditions:"/>
<outline text=""/>
<outline text="The above copyright notice and this permission notice shall be included in all"/>
<outline text="copies or substantial portions of the Software."/>
<outline text=""/>
<outline text="THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"/>
<outline text="IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"/>
<outline text="FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"/>
<outline text="AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"/>
<outline text="LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"/>
<outline text="OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE"/>
<outline text="SOFTWARE."/>
<outline text="*/"/>
</outline>
<outline text="" isComment="true"/>
<outline text=""/>
<outline text="exports.buildRssFeed = buildRssFeed;"/>
<outline text="exports.buildJsonFeed = buildJsonFeed;"/>
<outline text="exports.getEnclosureInfo = getRssEnclosureInfo;"/>
<outline text="exports.cloudPing = cloudPing;"/>
<outline text=""/>
<outline text="const utils = require ("daveutils");"/>
<outline text="const dateFormat = require ("dateformat");"/>
<outline text="const marked = require ("marked"); "/>
<outline text="const querystring = require ("querystring");"/>
<outline text="const request = require ("request");"/>
<outline text="const turndown = require ("turndown"); //11/10/25 by DW"/>
<outline text=""/>
<outline text="var urlSourceNamespace = "http://source.scripting.com/";"/>
<outline text="var urlGetRssEnclosureInfo = "http://pub2.fargo.io:5347/getEnclosureInfo?url=";"/>
<outline text="var rssCloudDefaults = { ">
<outline text="domain: "rpc.rsscloud.io","/>
<outline text="port: 5337,"/>
<outline text="path: "/ping" //12/29/21 by DW"/>
<outline text="path: "/pleaseNotify"" isComment="true"/>
<outline text="}"/>
</outline>
<outline text="var localTimeFormat = "ddd, mmmm d, yyyy h:MM TT Z";"/>
<outline text=""/>
<outline text="function cloudPing (urlServer, urlFeed, callback) {">
<outline text="Changes" isComment="true">
<outline text="5/31/17; 10:51:55 AM by DW">
<outline text="Per this thread, changed rq to use a form value instad of a body value. Don't ask me why this worked. Thanks to JY for puzzling it out. ">
<outline text="https://github.com/scripting/Scripting-News/issues/6"/>
</outline>
</outline>
<outline text="5/31/17; 8:50:37 AM by DW">
<outline text="Added callback param."/>
</outline>
</outline>
<outline text="if (urlServer === undefined) {">
<outline text="urlServer = "http://" + rssCloudDefaults.domain + ":" + rssCloudDefaults.port + rssCloudDefaults.path;"/>
<outline text="}"/>
</outline>
<outline text="var outgoingData = {">
<outline text="url: urlFeed"/>
<outline text="};"/>
</outline>
<outline text="var rq = {">
<outline text="uri: urlServer,"/>
<outline text="form: outgoingData"/>
<outline text="body: querystring.stringify (outgoingData)" isComment="true"/>
<outline text="};"/>
</outline>
<outline text="console.log ("rss.cloudPing: rq == " + utils.jsonStringify (rq));" isComment="true"/>
<outline text="request.post (rq, function (err, res, body) {">
<outline text="console.log ("cloudPing: urlServer == " + urlServer + ", urlFeed == " + urlFeed + ", res.statusCode == " + res.statusCode);" isComment="true"/>
<outline text="if (callback !== undefined) {">
<outline text="callback (err, res, body);"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function getRssEnclosureInfo (obj, callback) {">
<outline text="Changes" isComment="true">
<outline text="8/11/14; 10:32:02 PM by DW">
<outline text="obj is an element in an rssHistory array with an enclosure element with a url attribute. We call a FargoPub server to get the length and type of the enclosure."/>
</outline>
</outline>
<outline text="var jxhr = $.ajax ({ ">
<outline text="url: urlGetRssEnclosureInfo + encodeURIComponent (obj.enclosure.url),"/>
<outline text="dataType: "jsonp", "/>
<outline text="timeout: 30000,"/>
<outline text="jsonpCallback : "getData""/>
<outline text="}) "/>
</outline>
<outline text=".success (function (data, status) { ">
<outline text="if (data.flError != undefined) { //2/15/14 by DW" created="Sun, 16 Feb 2014 00:21:57 GMT" pgfnum="37754">
<outline text="obj.enclosure.flError = true;" created="Tue, 02 Jul 2013 15:40:24 GMT" pgfnum="27556"/>
<outline text="}" created="Sun, 16 Feb 2014 00:22:10 GMT" pgfnum="37758"/>
</outline>
<outline text="else {" created="Sun, 16 Feb 2014 00:22:11 GMT" pgfnum="37759">
<outline text="obj.enclosure.type = data.type;" created="Tue, 02 Jul 2013 15:40:24 GMT" pgfnum="27556"/>
<outline text="obj.enclosure.length = data.length;" created="Tue, 02 Jul 2013 15:40:24 GMT" pgfnum="27556"/>
<outline text="if (callback != undefined) {">
<outline text="callback ();"/>
<outline text="}"/>
</outline>
<outline text="}" created="Sun, 16 Feb 2014 00:22:14 GMT" pgfnum="37760"/>
</outline>
<outline text="}) "/>
</outline>
<outline text=".error (function (status) { ">
<outline text="console.log ("getEnclosureInfo: Error getting type and length -- " + jsonStringify (status));" created="Sun, 13 Jan 2013 14:34:21 GMT" pgfnum="17098"/>
<outline text="obj.enclosure.flError = true;" created="Tue, 02 Jul 2013 15:40:24 GMT" pgfnum="27556"/>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function markdownProcess (s) {">
<outline text="var renderer = new marked.Renderer ();"/>
<outline text="renderer.paragraph = function (s) {">
<outline text="return (s);"/>
<outline text="};"/>
</outline>
<outline text="var options = {">
<outline text="renderer: renderer"/>
<outline text="};"/>
</outline>
<outline text="return (marked (s, options));"/>
<outline text="}"/>
</outline>
<outline text="function whenMostRecentItem (historyArray) {">
<outline text="var ixMostRecent, whenMostRecent = new Date (0);"/>
<outline text="for (var i = 0; i < historyArray.length; i++) {">
<outline text="var when = new Date (historyArray [i].when);"/>
<outline text="if (when > whenMostRecent) {">
<outline text="whenMostRecent = when;"/>
<outline text="ixMostRecent = i;"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="return (whenMostRecent);"/>
<outline text="" isComment="true"/>
<outline text="" isComment="true"/>
<outline text="if (historyArray.length > 0) {" isComment="true">
<outline text="return (new Date (historyArray [0].when));"/>
<outline text="}"/>
</outline>
<outline text="else {" isComment="true">
<outline text="return (new Date (0));"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function timeToString (when) {">
<outline text="return (new Date (when).toGMTString ());"/>
<outline text="}"/>
</outline>
<outline text="function buildRssFeed (headElements, historyArray) {">
<outline text="Changes" isComment="true">
<outline text="11/10/25; 11:32:07 AM by DW" created="Mon, 10 Nov 2025 16:32:07 GMT">
<outline text="Added support for source:markdown, generating it from the item's text. " created="Mon, 10 Nov 2025 16:32:08 GMT"/>
</outline>
<outline text="6/4/25; 11:02:52 AM by DW" created="Wed, 04 Jun 2025 15:02:51 GMT">
<outline text="When building the <image> element, we were adding the description twice. Fixed." created="Wed, 04 Jun 2025 15:02:52 GMT"/>
</outline>
<outline text="12/4/24; 10:54:13 AM by DW" created="Wed, 04 Dec 2024 15:54:13 GMT">
<outline text="Added support for <webmaster>." created="Wed, 04 Dec 2024 15:54:13 GMT"/>
</outline>
<outline text="6/17/24; 2:30:16 PM by DW" created="Mon, 17 Jun 2024 18:30:15 GMT">
<outline text="Add support for itunes:author and itunes:type." created="Mon, 17 Jun 2024 18:30:16 GMT"/>
</outline>
<outline text="3/14/24; 1:22:46 PM by DW" created="Thu, 14 Mar 2024 17:22:46 GMT">
<outline text="Support for source:blogroll element." created="Tue, 28 Nov 2023 17:36:40 GMT"/>
</outline>
<outline text="11/28/23; 12:36:39 PM by DW" created="Tue, 28 Nov 2023 17:36:39 GMT">
<outline text="Support for <source:cloud> element." created="Tue, 28 Nov 2023 17:36:40 GMT"/>
</outline>
<outline text="4/4/23; 10:00:12 AM by DW" created="Tue, 04 Apr 2023 14:00:10 GMT">
<outline text="Previously, if an item had an enclosure that's an image, we'd generate a <source:outline> element for the image. " created="Tue, 04 Apr 2023 14:02:44 GMT"/>
<outline text="There is a note, below (9/23/14), on its addition, but no idea what the feature would be used for. " created="Tue, 04 Apr 2023 14:03:20 GMT"/>
<outline text="I'm going to disable the feature with a const flImageEnclosureIsOutline flag set to false. " created="Tue, 04 Apr 2023 14:03:54 GMT"/>
</outline>
<outline text="3/21/23; 9:43:57 AM by DW" created="Tue, 21 Mar 2023 13:43:56 GMT">
<outline text="Allow for source:account elements that are not from twitter. For an example, look in feedlanddatabase." created="Tue, 21 Mar 2023 13:43:57 GMT"/>
</outline>
<outline text="5/5/22; 11:22:20 AM by DW" created="Thu, 05 May 2022 15:22:20 GMT">
<outline text="If there's a markdowntext value for an item, generate a <source:markdown> element in the feed." created="Thu, 05 May 2022 15:22:20 GMT"/>
</outline>
<outline text="4/4/20; 2:45:47 PM by DW">
<outline text="Let's build a feed that Apple podcasts likes?">
<outline text="added support for channel-level image element"/>
<outline text="an itunes object that contains">
<outline text="category -- an array of categories, example below">
<outline text="itunes: {">
<outline text="category: ["news/politics", "government"]"/>
<outline text="}"/>
</outline>
</outline>
</outline>
</outline>
</outline>
<outline text="7/31/19; 11:00:42 AM by DW">
<outline text="Add support for <author> sub-element of item."/>
</outline>
<outline text="11/23/18; 11:39:07 AM by DW">
<outline text="Added support for support:likes element.">
<outline text="http://source.scripting.com/#1542988644000"/>
</outline>
</outline>
<outline text="7/25/18; 6:20:53 PM by DW">
<outline text="Added encoding="UTF-8" in the <?xml first line of the feed. "/>
</outline>
<outline text="5/28/17; 2:00:55 PM by DW">
<outline text="Forked from buildrss.js in libraries. There was lots of buggy cruft in here, I wanted to fix stuff, but without taking chances on breaking basically frozen apps like Radio3, LCE."/>
</outline>
<outline text="12/14/16; 4:45:40 PM by DW">
<outline text="If we have the ID of a tweet, create a <source:outline> element with type of "tweet" and don't look for an enclosure to create an image <source:outline>. One <source:outline> element per item is enough (and the enclosure data is already there)."/>
<outline text="Also, for <source:outline> elements, if the item has a title att use that in the text att instead of the text from the item. "/>
</outline>
<outline text="3/7/16; 10:36:37 AM by DW">
<outline text="If it's a Facebook Instant Articles feed, label it as such by including the IA namespace."/>
</outline>
<outline text="3/6/16; 1:35:31 PM by DW">
<outline text="In the comment at the head of the feed, don't use appDomain, use generator. "/>
</outline>
<outline text="3/4/16; 1:26:18 PM by DW">
<outline text="In previous versions headElements.flUseContentEncoded meant you did not have a <description> element. But it shouldn't be either/or. Feeds still need descriptions. "/>
</outline>
<outline text="2/22/16; 1:52:19 PM by DW">
<outline text="Implement headElements.flTitledItemsOnly, if true items without titles do not appear in the feed."/>
</outline>
<outline text="2/22/16; 1:28:38 PM by DW">
<outline text="If there's headElements.flUseContentEncoded is present and true, we generate content:encoded elements in place of descriptions. Also generate the namespace declaration for the content namespace. We needed this to implement a Facebook-compatible feed."/>
</outline>
<outline text="7/24/15; 11:59:04 AM by DW">
<outline text="If an item has flPgfLevelMarkdown set true, we process each paragraph as Markdown, separately. "/>
</outline>
<outline text="3/4/15; 7:38:03 PM by DW">
<outline text="Items can have titles."/>
</outline>
<outline text="10/25/14; 9:38:52 AM by DW">
<outline text="Check to see if enclosure type is defined before using it. If there was an error getting the type and length, it will not be defined. "/>
</outline>
<outline text="10/15/14; 12:10:47 PM by DW">
<outline text="If the item has an outline element, we use that to build source:outline."/>
</outline>
<outline text="9/23/14; 11:18:57 AM by DW">
<outline text="If an item has an enclosure that's an image, add a <source:outline> element of type image, whose url attribute points to the image."/>
</outline>
<outline text="8/1/14; 5:10:43 PM by DW">
<outline text="Created a central RSS builder for JavaScript."/>
</outline>
</outline>
<outline text="function encode (s) {">
<outline text="var lines = utils.encodeXml (s).split (String.fromCharCode (10));"/>
<outline text="var returnedstring = "";"/>
<outline text="for (var i = 0; i < lines.length; i++) {">
<outline text="returnedstring += utils.trimWhitespace (lines [i]);"/>
<outline text="if (i < (lines.length - 1)) {">
<outline text="returnedstring += "&#10;";"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="return (returnedstring);"/>
<outline text="}"/>
</outline>
<outline text="function whenMostRecentItem () {" isComment="true">
<outline text="if (historyArray.length > 0) {">
<outline text="return (new Date (historyArray [0].when));"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="return (new Date (0));"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function facebookEncodeContent (item, bodystring) {">
<outline text="Changes" isComment="true">
<outline text="7/5/17; 10:05:49 AM by DW">
<outline text="When generating the <address> use headElements.facebookPageName if present. item.name was the wrong value to use, it's the Twitter screen name. Hard to imagine how that would be relevant in Facebook. "/>
</outline>
<outline text="2/22/16; 5:21:05 PM by DW">
<outline text="Created. The content conforms to the spec on this page. ">
<outline text="https://developers.facebook.com/docs/instant-articles/guides/articlecreate"/>
</outline>
</outline>
</outline>
<outline text=""/>
<outline text="var htmltext = "";"/>
<outline text="function multipleReplaceAll (s, adrTable, flCaseSensitive, startCharacters, endCharacters) { ">
<outline text="if(flCaseSensitive===undefined){">
<outline text="flCaseSensitive = false;"/>
<outline text="}"/>
</outline>
<outline text="if(startCharacters===undefined){">
<outline text="startCharacters="";"/>
<outline text="}"/>
</outline>
<outline text="if(endCharacters===undefined){">
<outline text="endCharacters="";"/>
<outline text="}"/>
</outline>
<outline text="for( var item in adrTable){">
<outline text="var replacementValue = adrTable[item];"/>
<outline text="var regularExpressionModifier = "g";"/>
<outline text="if(!flCaseSensitive){">
<outline text="regularExpressionModifier = "gi";"/>
<outline text="}"/>
</outline>
<outline text="var regularExpressionString = (startCharacters+item+endCharacters).replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");"/>
<outline text="var regularExpression = new RegExp(regularExpressionString, regularExpressionModifier);"/>
<outline text="s = s.replace(regularExpression, replacementValue);"/>
<outline text="}"/>
</outline>
<outline text="return s;"/>
<outline text="}"/>
</outline>
<outline text="function massageHtml (s) {">
<outline text="var replaceTable = {">
<outline text=""<h4>": "<h2>","/>
<outline text=""</h4>": "</h2>","/>
<outline text=""<p></p>": """/>
<outline text="};"/>
</outline>
<outline text="return (multipleReplaceAll (s, replaceTable, false)); " created="Wed, 06 Nov 2013 17:58:18 GMT" pgfnum="31057"/>
<outline text="}"/>
</outline>
<outline text="function add (s) {" created="Wed, 19 Jun 2013 18:21:56 GMT" pgfnum="26656">
<outline text="htmltext += utils.filledString ("\t", indentlevel) + s + "\n";" created="Wed, 19 Jun 2013 18:22:33 GMT" pgfnum="26661"/>
<outline text="}" created="Wed, 19 Jun 2013 18:22:01 GMT" pgfnum="26658"/>
</outline>
<outline text="function formatDate (d) {">
<outline text=""/>
<outline text="return (""); //temp hack"/>
<outline text=""/>
<outline text="d = new Date (d);"/>
<outline text="return (d.toLocaleDateString () + "; " + d.toLocaleTimeString ());"/>
<outline text="}"/>
</outline>
<outline text="add ("");"/>
<outline text="add ("<!doctype html>");"/>
<outline text="add ("<html lang=\"en\" prefix=\"op: http://media.facebook.com/op#\">"); indentlevel++;"/>
<outline text="//head">
<outline text="add ("<head>"); indentlevel++;"/>
<outline text="add ("<meta charset=\"utf-8\">");"/>
<outline text="add ("<meta property=\"op:markup_version\" content=\"v1.0\">");"/>
<outline text="add ("<meta property=\"fb:article_style\" content=\"default\">"); //2/24/16 by DW"/>
<outline text="add ("<link rel=\"canonical\" href=\"" + item.link + "\">");"/>
<outline text="add ("</head>"); indentlevel--;"/>
</outline>
<outline text="//body">
<outline text="add ("<body>"); indentlevel++;"/>
<outline text="add ("<article>"); indentlevel++;"/>
<outline text="add ("<header>"); indentlevel++;"/>
<outline text="add ("<h1>" + item.title + "</h1>");"/>
<outline text="add ("<time class=\"op-published\" datetime=\"" + new Date (item.when).toISOString () + "\">" + formatDate (item.when) + "</time>");"/>
<outline text="if (item.whenupdate !== undefined) {">
<outline text="add ("<time class=\"op-modified\" dateTime=\"" + new Date (item.whenupdate).toISOString () + "\">" + formatDate (item.whenupdate) + "</time>");"/>
<outline text="}"/>
</outline>
<outline text="add ("<address><a>" + headElements.facebookPageName + "</a></address>"); //2/24/16 by DW"/>
<outline text="add ("<address><a>" + item.name + "</a></address>"); //2/24/16 by DW" isComment="true"/>
<outline text="add (massageHtml (bodystring));"/>
<outline text="add ("</header>"); indentlevel--;"/>
<outline text="add ("</article>"); indentlevel--;"/>
<outline text="add ("</body>"); indentlevel--;"/>
</outline>
<outline text="add ("</html>"); indentlevel--;"/>
<outline text="return (htmltext);"/>
<outline text="}"/>
</outline>
<outline text="function buildOutlineXml (theOutline) {">
<outline text="function addOutline (outline) {">
<outline text="var s = "<source:outline";"/>
<outline text="function hasSubs (outline) {">
<outline text="return (outline.subs != undefined) && (outline.subs.length > 0);"/>
<outline text="}"/>
</outline>
<outline text="function addAtt (name) {">
<outline text="if (outline [name] !== undefined) {">
<outline text="s += " " + name + "=\"" + encode (outline [name]) + "\"";"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="for (x in outline) { //6/28/17 by DW">
<outline text="if (x != "subs") { //5/16/19 by DW">
<outline text="addAtt (x);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="if (hasSubs (outline)) {">
<outline text="add (s + ">");"/>
<outline text="indentlevel++;"/>
<outline text="for (var i = 0; i < outline.subs.length; i++) {">
<outline text="addOutline (outline.subs [i]);"/>
<outline text="}"/>
</outline>
<outline text="add ("</source:outline>");"/>
<outline text="indentlevel--;"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="add (s + "/>");"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="addOutline (theOutline);"/>
<outline text="return (xmltext);"/>
<outline text="}"/>
</outline>
<outline text="var xmltext = "", indentlevel = 0, now = new Date (); nowstring = now.toGMTString ();"/>
<outline text="var username = headElements.twitterScreenName, maxitems = headElements.maxFeedItems;"/>
<outline text="var contentNamespaceDecl = "", facebookNamespaceDecl = "", itunesNamespaceDecl = "";"/>
<outline text="const flImageEnclosureIsOutline = false; //4/4/23 by DW" created="Tue, 04 Apr 2023 14:04:58 GMT"/>
<outline text="const myTurndown = new turndown (); //11/10/25 by DW" created="Mon, 10 Nov 2025 16:21:46 GMT"/>
<outline text="" created="Mon, 10 Nov 2025 16:21:46 GMT"/>
<outline text="function add (s) {" created="Wed, 19 Jun 2013 18:21:56 GMT" pgfnum="26656">
<outline text="console.log (s);" isComment="true"/>
<outline text="xmltext += utils.filledString ("\t", indentlevel) + s + "\n";" created="Wed, 19 Jun 2013 18:22:33 GMT" pgfnum="26661"/>
<outline text="}" created="Wed, 19 Jun 2013 18:22:01 GMT" pgfnum="26658"/>
</outline>
<outline text="function addAccount (servicename, username) {" created="Wed, 19 Jun 2013 18:21:56 GMT" pgfnum="26656">
<outline text="if ((username != undefined) && (username.length > 0)) { " created="Mon, 29 Jul 2013 16:07:48 GMT" pgfnum="28526">
<outline text="add ("<source:account service=\"" + encode (servicename) + "\">" + encode (username) + "</source:account>");"/>
<outline text="}" created="Mon, 29 Jul 2013 16:08:50 GMT" pgfnum="28529"/>
</outline>
<outline text="}" created="Wed, 19 Jun 2013 18:22:01 GMT" pgfnum="26658"/>
</outline>
<outline text=""/>
<outline text="add ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //7/25/18 by DW"/>
<outline text="add ("<!-- RSS generated by " + headElements.generator + " on " + nowstring + " -->")"/>
<outline text=""/>
<outline text="if (utils.getBoolean (headElements.flUseContentEncoded)) { //2/22/16 by DW">
<outline text="contentNamespaceDecl = " xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"";"/>
<outline text="}"/>
</outline>
<outline text="if (utils.getBoolean (headElements.flFacebookEncodeContent)) { //3/7/16 by DW">
<outline text="facebookNamespaceDecl = " xmlns:IA=\"http://rss2.io/ia/\"";"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.itunes !== undefined) { //4/4/20 by DW">
<outline text="itunesNamespaceDecl = " xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"";"/>
<outline text="}"/>
</outline>
<outline text=""/>
<outline text="add ("<rss version=\"2.0\" xmlns:source=\"" + urlSourceNamespace + "\"" + contentNamespaceDecl + facebookNamespaceDecl + itunesNamespaceDecl + ">"); indentlevel++"/>
<outline text="add ("<channel>"); indentlevel++;"/>
<outline text="//add header elements" created="Wed, 19 Jun 2013 22:42:02 GMT" pgfnum="26761">
<outline text="function addIfDefined (name, value) {">
<outline text="if (value !== undefined) {">
<outline text="add ("<" + name + ">" + encode (value) + "</" + name + ">");"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="console.log ("buildRssFeed: headElements == " + utils.jsonStringify (headElements)); //11/23/18 by DW" isComment="true"/>
<outline text="addIfDefined ("title", headElements.title);"/>
<outline text="addIfDefined ("link", headElements.link);"/>
<outline text="addIfDefined ("description", headElements.description);"/>
<outline text="add ("<pubDate>" + whenMostRecentItem (historyArray).toUTCString () + "</pubDate>"); "/>
<outline text="addIfDefined ("language", headElements.language);"/>
<outline text="addIfDefined ("generator", headElements.generator);"/>
<outline text="addIfDefined ("copyright", headElements.copyright);"/>
<outline text="addIfDefined ("docs", headElements.docs);"/>
<outline text="add ("<lastBuildDate>" + nowstring + "</lastBuildDate>");"/>
<outline text="//<cloud> element -- 6/5/15 by DW">
<outline text="if (headElements.flRssCloudEnabled) {">
<outline text="add ("<cloud domain=\"" + headElements.rssCloudDomain + "\" port=\"" + headElements.rssCloudPort + "\" path=\"" + headElements.rssCloudPath + "\" registerProcedure=\"" + headElements.rssCloudRegisterProcedure + "\" protocol=\"" + headElements.rssCloudProtocol + "\" />")"/>
<outline text="addIfDefined ("source:cloud", headElements.rssCloudUrl); //11/28/23 by DW"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//<image> element -- 4/4/20 by DW">
<outline text="if (headElements.image !== undefined) {">
<outline text="add ("<image>"); indentlevel++;"/>
<outline text="add ("<title>" + encode (headElements.image.title) + "</title>");"/>
<outline text="add ("<url>" + encode (headElements.image.url) + "</url>");"/>
<outline text="add ("<link>" + encode (headElements.image.link) + "</link>");"/>
<outline text="if (headElements.image.description !== undefined) { //optional">
<outline text="add ("<description>" + encode (headElements.image.description) + "</description>");"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.image.width !== undefined) { //optional">
<outline text="add ("<width>" + encode (headElements.image.width) + "</width>");"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.image.height !== undefined) { //optional">
<outline text="add ("<height>" + encode (headElements.image.height) + "</height>");"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.image.description !== undefined) { //optional -- commented 6/4/25 by DW" isComment="true">
<outline text="add ("<description>" + encode (headElements.image.description) + "</description>");"/>
<outline text="}"/>
</outline>
<outline text="add ("</image>"); indentlevel--;"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//<itunes> -- 4/4/20 by DW">
<outline text="if (headElements.itunes !== undefined) {">
<outline text="if (headElements.itunes.author !== undefined) { //6/17/24 by DW">
<outline text="add ("<itunes:author>" + encode (headElements.itunes.author) + "</itunes:author>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.itunes.category !== undefined) { //an array of categories">
<outline text="headElements.itunes.category.forEach (function (item) {">
<outline text="var splits = item.split ("/"), catclosetag = "</itunes:category>";"/>
<outline text="function getcat (theCat) {">
<outline text="return ("<itunes:category text=\"" + encode (theCat) + "\">");"/>
<outline text="}"/>
</outline>
<outline text="if (splits.length == 1) {">
<outline text="add (getcat (item) + catclosetag);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="add (getcat (splits [0]) + getcat (splits [1]) + catclosetag + catclosetag);"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="if (headElements.itunes.explicit !== undefined) { //must be yes, no or clean">
<outline text="add ("<itunes:explicit>" + encode (headElements.itunes.explicit) + "</itunes:explicit>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.itunes.type !== undefined) { //episodic or serial 6/17/24 by DW">
<outline text="add ("<itunes:type>" + encode (headElements.itunes.type) + "</itunes:type>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="addAccount ("twitter", username); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("facebook", headElements.ownerFacebookAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("github", headElements.ownerGithubAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("linkedin", headElements.ownerLinkedinAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="add ("<source:localTime>" + dateFormat (now, localTimeFormat) + "</source:localTime>");"/>
<outline text="//<source:self> -- 5/20/24 by DW" created="Mon, 20 May 2024 20:50:16 GMT">
<outline text="if (headElements.urlSelf !== undefined) {">
<outline text="add ("<source:self>" + encode (headElements.urlSelf) + "</source:self>"); "/>
<outline text="}"/>
</outline>
</outline>
<outline text="if (headElements.likes !== undefined) { //11/23/18 by DW">
<outline text="add ("<source:likes>" + encode (headElements.likes) + "</source:likes>");"/>
<outline text="}"/>
</outline>
<outline text="if (headElements.urlBlogrollOpml !== undefined) { //3/14/24 by DW">
<outline text="add ("<source:blogroll>" + encode (headElements.urlBlogrollOpml) + "</source:blogroll>");"/>
<outline text="}"/>
</outline>
<outline text="addIfDefined ("webmaster", headElements.webmaster); //12/4/24 by DW"/>
</outline>
<outline text="//add items">
<outline text="var ctitems = 0;"/>
<outline text="for (var i = 0; (i < historyArray.length) && (ctitems < maxitems); i++) {">
<outline text="var item = historyArray [i];"/>
<outline text="if ((!utils.getBoolean (headElements.flTitledItemsOnly)) || (item.title !== undefined)) { //2/22/16 by DW">
<outline text="var itemcreated = timeToString (item.when), itemtext = encode (item.text);"/>
<outline text="var linktotweet = encode ("https://twitter.com/" + username + "/status/" + item.idTweet);"/>
<outline text="add ("<item>"); indentlevel++;"/>
<outline text="if (item.title !== undefined) {">
<outline text="add ("<title>" + encode (item.title) + "</title>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="if (item.text !== undefined) {">
<outline text="var theDescription = item.text;"/>
<outline text="if (item.outline !== undefined) {">
<outline text="switch (item.outline.type) {">
<outline text="case "markdown":">
<outline text="theDescription = markdownProcess (theDescription);"/>
<outline text="break;"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="add ("<description>" + encode (theDescription) + "</description>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="if (utils.getBoolean (headElements.flUseContentEncoded)) { //7/4/17 by DW">
<outline text="var encodedDescription = theDescription;"/>
<outline text="add ("<content:encoded><![CDATA["); indentlevel++;"/>
<outline text="if (utils.getBoolean (headElements.flFacebookEncodeContent)) {">
<outline text="encodedDescription = facebookEncodeContent (item, encodedDescription);"/>
<outline text="}"/>
</outline>
<outline text="add (encodedDescription);"/>
<outline text="add ("]]></content:encoded>"); indentlevel--;"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="add ("<pubDate>" + itemcreated + "</pubDate>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="if (item.link !== undefined) {">
<outline text="add ("<link>" + encode (item.link) + "</link>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="//source:linkShort -- 8/26/14 by DW">
<outline text="if (item.linkShort !== undefined) {">
<outline text="add ("<source:linkShort>" + encode (item.linkShort) + "</source:linkShort>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//guid -- 8/12/14 by DW">
<outline text="if (item.guid != undefined) {">
<outline text="if (utils.getBoolean (item.guid.flPermalink)) {">
<outline text="add ("<guid>" + encode (item.guid.value) + "</guid>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="add ("<guid isPermaLink=\"false\">" + encode (item.guid.value) + "</guid>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="//author -- 7/31/19 by DW">
<outline text="if (item.author !== undefined) { ">
<outline text="add ("<author>" + encode (item.author) + "</author>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//enclosure -- 8/11/14 by DW">
<outline text="if (item.enclosure != undefined) {">
<outline text="var enc = item.enclosure;"/>
<outline text="if ((enc.url != undefined) && (enc.type != undefined) && (enc.length != undefined)) {">
<outline text="add ("<enclosure url=\"" + enc.url + "\" type=\"" + enc.type + "\" length=\"" + enc.length + "\"/>");"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="//source:jsonUrl -- 3/24/15 by DW">
<outline text="if (item.linkJson !== undefined) {">
<outline text="add ("<source:linkJson>" + encode (item.linkJson) + "</source:linkJson>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//source:markdown -- 5/5/22 by DW & 11/10/25 by DW">
<outline text="if (item.markdowntext !== undefined) {">
<outline text="add ("<source:markdown>" + encode (item.markdowntext) + "</source:markdown>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}"/>
</outline>
<outline text="else {" created="Mon, 10 Nov 2025 16:26:36 GMT">
<outline text="if (utils.getBoolean (headElements.flSourceMarkdown)) { //11/10/25 by DW " created="Mon, 10 Nov 2025 16:19:41 GMT">
<outline text="if (item.text !== undefined) {" created="Mon, 10 Nov 2025 16:23:27 GMT">
<outline text="try {" created="Mon, 10 Nov 2025 16:28:50 GMT">
<outline text="const mdtext = myTurndown.turndown (item.text);"/>
<outline text="add ("<source:markdown>" + encode (mdtext) + "</source:markdown>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="}" created="Mon, 10 Nov 2025 16:28:51 GMT"/>
</outline>
<outline text="catch (err) {" created="Mon, 10 Nov 2025 16:28:52 GMT">
<outline text="console.log ("turndown: err.message == " + err.message);" created="Mon, 10 Nov 2025 16:29:01 GMT"/>
<outline text="}" created="Mon, 10 Nov 2025 16:28:55 GMT"/>
</outline>
<outline text="}" created="Mon, 10 Nov 2025 16:23:28 GMT"/>
</outline>
<outline text="}" created="Mon, 10 Nov 2025 16:20:15 GMT"/>
</outline>
<outline text="}" created="Mon, 10 Nov 2025 16:26:38 GMT"/>
</outline>
</outline>
<outline text="//source:outline">
<outline text="if (item.outline != undefined) { //10/15/14 by DW">
<outline text="buildOutlineXml (item.outline);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="var outlineTextAtt = itemtext; //12/14/16 by DW"/>
<outline text="if (item.title !== undefined) {">
<outline text="if (item.title.length > 0) {">
<outline text="outlineTextAtt = encode (item.title);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="if (item.idTweet != undefined) {">
<outline text="add ("<source:outline text=\"" + outlineTextAtt + "\" created=\"" + itemcreated + "\" type=\"tweet\" tweetId=\"" + item.idTweet + "\" tweetUserName=\"" + encode (item.twitterScreenName) + "\"/>");"/>
<outline text="}"/>
</outline>
<outline text="else { //12/14/16 by DW">
<outline text="if (flImageEnclosureIsOutline) { //4/4/23 by DW" created="Tue, 04 Apr 2023 14:05:23 GMT">
<outline text="if (item.enclosure != undefined) { //9/23/14 by DW">
<outline text="var enc = item.enclosure;"/>
<outline text="if (enc.type != undefined) { //10/25/14 by DW">
<outline text="if (utils.beginsWith (enc.type.toLowerCase (), "image")) {">
<outline text="add ("<source:outline text=\"" + outlineTextAtt + "\" created=\"" + itemcreated + "\" type=\"image\" url=\"" + enc.url + "\"/>");"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}" created="Tue, 04 Apr 2023 14:05:25 GMT"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="//category -- 12/18/18 by DW">
<outline text="if (item.categories !== undefined) { //must be an array">
<outline text="if (Array.isArray (item.categories)) {">
<outline text="item.categories.forEach (function (item) {">
<outline text="add ("<category>" + item + "</category>"); " created="Wed, 19 Jun 2013 18:20:46 GMT" pgfnum="26653"/>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="//source:account for twitter only -- 12/18/18 by DW">
<outline text="if (item.twitterScreenName !== undefined) { ">
<outline text="addAccount ("twitter", item.twitterScreenName); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="}"/>
</outline>
</outline>
<outline text="//source:account for other services -- 3/21/23 by DW" created="Tue, 21 Mar 2023 13:42:37 GMT">
<outline text="if (item.account !== undefined) { ">
<outline text="try {" created="Tue, 21 Mar 2023 13:44:41 GMT">
<outline text="if ((item.account.service !== undefined) && (item.account.name !== undefined)) {" created="Tue, 21 Mar 2023 13:45:08 GMT">
<outline text="addAccount (item.account.service, item.account.name); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="}" created="Tue, 21 Mar 2023 13:45:25 GMT"/>
</outline>
<outline text="}" created="Tue, 21 Mar 2023 13:44:47 GMT"/>
</outline>
<outline text="catch (err) {" created="Tue, 21 Mar 2023 13:44:48 GMT">
<outline text="}" created="Tue, 21 Mar 2023 13:44:57 GMT"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="" created="Mon, 10 Nov 2025 16:19:34 GMT"/>
<outline text="add ("</item>"); indentlevel--;"/>
<outline text="ctitems++;"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="add ("</channel>"); indentlevel--;"/>
<outline text="add ("</rss>"); indentlevel--;"/>
<outline text="return (xmltext);"/>
<outline text="}"/>
</outline>
<outline text="function buildJsonFeed (headElements, historyArray) {">
<outline text="Changes" isComment="true">
<outline text="6/4/17; 8:27:09 AM by DW">
<outline text="If headElements.docsForJsonFeed is defined use that instead of headElements.docs."/>
</outline>
<outline text="5/26/17; 12:37:26 PM by DW">
<outline text="There's a difference between the way we handle Markdown and the way buildRssFeed does. He's looking for an flMarkdown attribute to trigger the processing. But that code will only work in client-based implementations. I don't have the bandwidth right now to sort out the differences. But I don't believe I have any current products using that feature. I guess we'll find out. ;-)"/>
</outline>
<outline text="5/25/17; 2:16:03 PM by DW">
<outline text="Using the same datastructure that buildRssFeed users, create an equivalent JSON text. "/>
</outline>
</outline>
<outline text="var now = new Date (); nowstring = now.toGMTString ();"/>
<outline text="var username = headElements.twitterScreenName, maxitems = headElements.maxFeedItems;"/>
<outline text="function addAccount (servicename, username) {" created="Wed, 19 Jun 2013 18:21:56 GMT" pgfnum="26656">
<outline text="if ((username != undefined) && (username.length > 0)) { " created="Mon, 29 Jul 2013 16:07:48 GMT" pgfnum="28526">
<outline text="var accounts;"/>
<outline text="if (jstruct.rss.channel ["source:account"] === undefined) {">
<outline text="jstruct.rss.channel ["source:account"] = new Array ();"/>
<outline text="}"/>
</outline>
<outline text="accounts = jstruct.rss.channel ["source:account"];"/>
<outline text="accounts [accounts.length] = {">
<outline text="service: servicename,"/>
<outline text=""#value": username"/>
<outline text="};"/>
</outline>
<outline text="}" created="Mon, 29 Jul 2013 16:08:50 GMT" pgfnum="28529"/>
</outline>
<outline text="}" created="Wed, 19 Jun 2013 18:22:01 GMT" pgfnum="26658"/>
</outline>
<outline text="function whenMostRecentItem () {" isComment="true">
<outline text="if (historyArray.length > 0) {">
<outline text="return (new Date (historyArray [0].when));"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="return (new Date (0));"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function timeToString (when) {" isComment="true">
<outline text="return (new Date (when).toGMTString ());"/>
<outline text="}"/>
</outline>
<outline text="var jstruct = {">
<outline text="rss: {">
<outline text="version: "2.0","/>
<outline text=""xmlns:source": urlSourceNamespace,"/>
<outline text="channel: {">
<outline text="title: headElements.title,"/>
<outline text="link: headElements.link,"/>
<outline text="description: headElements.description,"/>
<outline text="pubDate: whenMostRecentItem (historyArray).toUTCString (),"/>
<outline text="lastBuildDate: nowstring,"/>
<outline text="language: headElements.language,"/>
<outline text="copyright: headElements.copyright,"/>
<outline text="generator: headElements.generator,"/>
<outline text="docs: (headElements.docsForJsonFeed === undefined) ? headElements.docs : headElements.docsForJsonFeed, //6/4/17 by DW"/>
<outline text=""source:localTime": dateFormat (now, localTimeFormat)"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="if (headElements.flRssCloudEnabled) {">
<outline text="jstruct.rss.channel.cloud = {">
<outline text="domain: headElements.rssCloudDomain,"/>
<outline text="port: headElements.rssCloudPort,"/>
<outline text="path: headElements.rssCloudPath,"/>
<outline text="registerProcedure: headElements.rssCloudRegisterProcedure,"/>
<outline text="protocol: headElements.rssCloudProtocol"/>
<outline text="};"/>
</outline>
<outline text="}"/>
</outline>
<outline text="addAccount ("twitter", username); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("facebook", headElements.ownerFacebookAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("github", headElements.ownerGithubAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="addAccount ("linkedin", headElements.ownerLinkedinAccount); " created="Mon, 29 Jul 2013 16:07:47 GMT" pgfnum="28525"/>
<outline text="//add items">
<outline text="var ctitems = 0, items = jstruct.rss.channel.item = new Array ();"/>
<outline text="for (var i = 0; (i < historyArray.length) && (ctitems < maxitems); i++) {">
<outline text="var item = historyArray [i], feedItem = new Object ();"/>
<outline text="if ((!utils.getBoolean (headElements.flTitledItemsOnly)) || (item.title !== undefined)) { //2/22/16 by DW">
<outline text="var itemcreated = timeToString (item.when);"/>
<outline text="feedItem.title = item.title;"/>
<outline text="feedItem.link = item.link;"/>
<outline text="//description">
<outline text="feedItem.description = item.text;"/>
<outline text="if (item.outline !== undefined) {">
<outline text="switch (item.outline.type) {">
<outline text="case "markdown":">
<outline text="feedItem.description = markdownProcess (feedItem.description);"/>
<outline text="break;"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="feedItem.pubDate = itemcreated;"/>
<outline text=""/>
<outline text="//guid">
<outline text="if (item.guid !== undefined) {">
<outline text="if (utils.getBoolean (item.guid.flPermalink)) {">
<outline text="feedItem.guid = item.guid.value;"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="feedItem.guid = {">
<outline text="isPermaLink: false,"/>
<outline text=""#value": item.guid.value"/>
<outline text="};"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>