Skip to content
Newer
Older
100644 146 lines (123 sloc) 4.18 KB
af6dbc0 @davorg Initial revision
authored
1 [% DEFAULT file = 'feeds.yaml';
e424a8c @davorg Added timestamp
authored
2 USE date;
af6dbc0 @davorg Initial revision
authored
3 USE YAML;
4f700b5 @davorg Added OPML support
authored
4 sources = YAML.undumpfile(file);
5 PROCESS opml.tt | redirect('newsfeeds.opml') -%]
bc19b18 @davorg Added Daily Express. Tidied up a lot of broken screen-scraping code.
authored
6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
af6dbc0 @davorg Initial revision
authored
8 <html>
9 <head>
10 <title>UK National Newspaper RSS Feeds</title>
11 <link rel="stylesheet" href="style.css" type="text/css" />
12 <script src="/js/display.js"></script>
13 <script>
14 function show_hide (select) {
15 if (select.value == "all") {
16 show_all('source');
17 } else {
18 show_one('source', select.value);
19 }
20 }
21
22 function filter (evt) {
23 evt = (evt) ? evt : ((window.event) ? event : null);
24
25 var charCode = (evt.charCode) ? evt.charCode :
26 ((evt.which) ? evt.which : evt.keyCode);
27
28 var elem = (evt.target) ? evt.target :
29 ((evt.srcElement) ? evt.srcElement : null);
30
31 var text = elem.value;
32
33 if (charCode == 13) {
34 return false;
35 }
36
37 if (charCode == 46) {
38 return false;
39 }
40
41 if (charCode == 8) {
42 text = text.slice(0, -1);
43 } else {
44 text = text + String.fromCharCode(charCode);
45 }
46
47 filter_it(text);
48 }
49
50 function filter_it (text) {
51 var regex = new RegExp(text, "i");
52
53 var items = document.getElementsByTagName('li');
54
55 for (var i = 0; i < items.length; i++) {
56 if (items[i].childNodes[0].text.match(regex)) {
57 items[i].style.display = 'list-item';
58 } else {
59 items[i].style.display = 'none';
60 }
61 }
62 }
63 </script>
64 </head>
65 <body>
66 <h1>UK National Newspaper RSS Feeds</h1>
67
68 <p>This page contains a list of UK newspaper<sup><a id="fn1" href="#">[1] <span>Ok. Yes, I included the BBC which isn't a newspaper. It's my page and I make the rules.</span></a></sup> RSS feeds. For more
69 information about what RSS is and how to use it, see
70 <a href="http://mag-sol.com/Articles/article.cgi?art=rss">this
71 article</a>.</p>
72
73 <p>All of these feeds are almost certainly covered by terms and
74 conditions which you should read by following the "more information"
75 link for each source.</p>
76
77 <p>If you know of any other feeds produced by a UK newspaper, then I'd
78 love to know about it. Please <a href="mailto:dave@dave.org.uk">let
79 me know</a>.</p>
80
4f700b5 @davorg Added OPML support
authored
81 <p><b>Update:</b> Added OPML files. There's one that contains everything
82 and one for each individual source.</p>
af6dbc0 @davorg Initial revision
authored
83
84 <p>Choose a source: <select onchange="show_hide(this)">
85 <option value="all">All Sources</option>
86 [% FOREACH source IN sources -%]
87 <option value="[% source.code %]">[% source.desc %]</option>
88 [% END -%]
89 </select>
90 and/or filter the list:
91 <input type="text" onkeypress="filter(event)" onchange="filter_it(this.value)" id="filter" /></p>
92
4f700b5 @davorg Added OPML support
authored
93 <p><a href="newsfeeds.opml">OPML</a></p>
94
95 [% FOREACH source IN sources;
96 opml = source.code _ '.opml';
97 PROCESS one_opml.tt | redirect(opml) -%]
af6dbc0 @davorg Initial revision
authored
98 <div class="source" id="[% source.code %]">
99 <h2>[% source.desc %]</h2>
4f700b5 @davorg Added OPML support
authored
100 <p><a href="[% source.start %]">More information</a> /
101 <a href="[% source.code %].opml">OPML</a></p>
af6dbc0 @davorg Initial revision
authored
102 <ul>
103 [% FOREACH feed IN source.feeds -%]
104 <li><a href="[% feed.url %]">[% feed.desc %]</a></li>
105 [% END -%]
106 </ul>
107 </div>
108 [% END -%]
109
110 <div id="credits">
111 Page created by <a href="http://dave.org.uk/">Dave Cross</a>
bc19b18 @davorg Added Daily Express. Tidied up a lot of broken screen-scraping code.
authored
112 using <a href="http://svn.mag-sol.com/newsfeeds/">newsfeeds</a>
e424a8c @davorg Added timestamp
authored
113 at [% date.format(date.now, '%Y-%m-%d %H:%M') %]
730beb7 @davorg Added links to source code, raw data and yaml.org
authored
114 <br /><a href="feeds.yaml">Raw data</a>
115 (in <a href="http://www.yaml.org/">YAML</a> format).
af6dbc0 @davorg Initial revision
authored
116 </div>
117
118 <div id="ads">
119 <script type="text/javascript"><!--
120 google_ad_client = "pub-3663319204757145";
121 google_ad_width = 120;
122 google_ad_height = 600;
123 google_ad_format = "120x600_as";
124 google_ad_type = "text";
125 google_ad_channel ="2532784732";
126 google_color_border = "CCCCCC";
127 google_color_bg = "FFFFFF";
128 google_color_link = "999999";
129 google_color_url = "6666FF";
130 google_color_text = "000000";
131 //--></script>
132 <script type="text/javascript"
133 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
134 </script>
135 </div>
136
137 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
138 </script>
139 <script type="text/javascript">
140 _uacct = "UA-56332-2";
141 urchinTracker();
142 </script>
143
144 </body>
145 </html>
Something went wrong with that request. Please try again.