forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.html
More file actions
309 lines (281 loc) Β· 8.96 KB
/
rss.html
File metadata and controls
309 lines (281 loc) Β· 8.96 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RSS Feed Aggregator</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 900px;
margin: auto;
padding: 1rem;
background-color: var(--bg);
color: var(--text);
transition: background-color 0.3s, color 0.3s;
}
:root {
--bg: #ffffff;
--text: #000000;
}
.dark-mode {
--bg: #1e1e1e;
--text: #c9d1d9;
}
.header {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
margin-bottom: 1rem;
}
.header img {
width: 50%;
height: auto;
border-radius: 10px;
margin: 1rem 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.controls {
margin: 1rem 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.controls button {
margin: 0.5rem;
padding: 0.5rem 1rem;
font-size: 1rem;
cursor: pointer;
border: none;
border-radius: 5px;
background-color: #007acc;
color: white;
transition: background-color 0.3s;
}
.controls button:hover {
background-color: #005f99;
}
.feed {
margin-bottom: 2rem;
}
.item {
margin: 0.8rem 0;
padding: 0.8rem;
border-bottom: 1px solid #ccc;
}
.item a {
text-decoration: none;
color: #007acc;
font-weight: bold;
}
.archive-notice {
margin: 2rem 0 1rem;
text-align: center;
font-style: italic;
opacity: 0.7;
}
.feed-section {
margin-top: 2rem;
}
.feed-title {
font-size: 1.5rem;
margin-bottom: 0.5rem;
border-bottom: 2px solid #ccc;
padding-bottom: 0.5rem;
}
#loading {
text-align: center;
margin: 2rem;
font-size: 1.2rem;
}
#backToTop {
display: none;
position: fixed;
bottom: 30px;
right: 30px;
z-index: 100;
font-size: 1rem;
padding: 0.7rem 1.2rem;
border: none;
border-radius: 50px;
background-color: #007acc;
color: white;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
#backToTop:hover {
background-color: #005f99;
}
</style>
</head>
<body>
<div class="header">
<h1>π° RSS Feed Aggregator</h1>
<p>Aggregating database, reliability, and monitoring feeds in one place.</p>
<img src="images/devops_composite.png" alt="DevOps Ecosystem">
</div>
<div class="controls">
<button onclick="toggleTheme()">π Toggle Dark Mode</button>
<button onclick="refreshFeeds()">π Refresh Feeds</button>
<button onclick="toggleArchive()">π Toggle Archives</button>
<button onclick="toggleGroup()">ποΈ Group by Feed</button>
</div>
<div id="loading">Loading feeds, please wait...</div>
<div id="feeds"></div>
<button id="backToTop" onclick="scrollToTop()">β¬οΈ Top</button>
<script src="https://unpkg.com/rss-parser/dist/rss-parser.min.js"></script>
<script>
const feeds = [
{ name: "Database News", url: "https://database.news/feed.xml", favicon: "database.news" },
{ name: "Postgres Weekly", url: "https://postgresweekly.com/rss/", favicon: "postgresweekly.com" },
{ name: "Planet PostgreSQL", url: "https://planet.postgresql.org/rss20_short.xml", favicon: "planet.postgresql.org" },
{ name: "Monitoring Love", url: "https://monitoring.love/feed.xml", favicon: "monitoring.love" },
{ name: "DBTA", url: "https://www.dbta.com/rss/rss_feeds.aspx", favicon: "dbta.com" },
{ name: "DevOpIsh Firehose", url: "https://bg.raindrop.io/rss/public/15805349", favicon: "raindrop.io" },
{ name: "Planet PostGIS", url: "https://planet.postgis.net/rss20.xml", favicon: "planet.postgis.net" },
{ name: "PGMustard", url: "https://www.pgmustard.com/blog?format=rss" },
{ name: "Azure for PostgreSQL", url: "https://techcommunity.microsoft.com/t5/s/gxcuf89792/rss/board?board.id=ADforPostgreSQL" },
{ name: "Software and Booz", url: "https://www.softwareandbooz.com/feed/" },
{ name: "DBI Services", url: "https://www.dbi-services.com/blog/category/postgresql/feed/" },
{ name: "PgPedia", url: "https://pgpedia.info/blog/index.html?mode=rdf" },
{ name: "Postgres FM", url: "https://feeds.transistor.fm/postgres-fm" },
{ name: "High Scalability", url: "https://highscalability.com/rss/" },
{ name: "AWS Database Blog", url: "https://aws.amazon.com/blogs/database/feed/" },
{ name: "Kernel Planet", url: "https://planet.kernel.org/rss20.xml" },
{ name: "Jespen IO Blog", url: "https://jepsen.io/blog.rss" }
// commented out { name: "CVE Threats", url: "https://cve.threatint.eu/rss/new.rss" }
];
const corsProxy = "https://api.allorigins.win/raw?url=";
const parser = new RSSParser();
const feedsContainer = document.getElementById('feeds');
const loadingIndicator = document.getElementById('loading');
const backToTopButton = document.getElementById('backToTop');
let allItems = [];
let showArchive = false;
let groupByFeed = false;
let loadedFeeds = 0;
async function fetchFeeds() {
loadingIndicator.style.display = 'block';
feedsContainer.innerHTML = '';
allItems = [];
loadedFeeds = 0;
const fetchPromises = feeds.map(async (feed) => {
try {
const response = await fetch(corsProxy + encodeURIComponent(feed.url));
const text = await response.text();
const parsed = await parser.parseString(text);
parsed.items.forEach(item => {
const pubDate = new Date(item.pubDate || item.isoDate || Date.now());
allItems.push({
title: item.title,
link: item.link,
pubDate: pubDate,
feedName: feed.name
});
});
} catch (err) {
console.error('Error loading feed:', feed.url, err);
} finally {
loadedFeeds++;
loadingIndicator.innerText = `Loading feeds (${loadedFeeds}/${feeds.length})...`;
}
});
await Promise.all(fetchPromises);
allItems.sort((a, b) => b.pubDate - a.pubDate);
renderFeeds();
}
function renderFeeds() {
loadingIndicator.style.display = 'none';
feedsContainer.innerHTML = '';
const today = new Date();
const daysAgo30 = new Date();
daysAgo30.setDate(today.getDate() - 30);
const recentItems = allItems.filter(item => item.pubDate >= daysAgo30);
const archiveItems = allItems.filter(item => item.pubDate < daysAgo30);
const itemsToDisplay = showArchive ? archiveItems : recentItems;
if (itemsToDisplay.length === 0) {
feedsContainer.innerHTML = '<p>No posts found in this range.</p>';
return;
}
if (showArchive) {
feedsContainer.innerHTML = `<div class="archive-notice">π Viewing archive posts (older than 30 days)</div>`;
}
if (!groupByFeed) {
itemsToDisplay.forEach(item => renderItem(item));
} else {
const grouped = {};
itemsToDisplay.forEach(item => {
if (!grouped[item.feedName]) grouped[item.feedName] = [];
grouped[item.feedName].push(item);
});
Object.keys(grouped).sort().forEach(feedName => {
const section = document.createElement('div');
section.className = 'feed-section';
section.innerHTML = `<div class="feed-title">π° ${feedName}</div>`;
grouped[feedName].sort((a, b) => b.pubDate - a.pubDate);
grouped[feedName].forEach(item => {
section.appendChild(renderItem(item, true));
});
feedsContainer.appendChild(section);
});
}
}
function renderItem(item, returnElement = false) {
const domain = getFaviconDomain(item.feedName, item.link);
const faviconUrl = `https://www.google.com/s2/favicons?sz=32&domain_url=${domain}`;
const itemDiv = document.createElement('div');
itemDiv.className = 'item';
itemDiv.innerHTML = `
<img src="${faviconUrl}" alt="" style="vertical-align: middle; margin-right:5px; width:16px; height:16px;"
onerror="this.onerror=null;this.src='https://upload.wikimedia.org/wikipedia/commons/6/6b/Feedbin-Icon-home.png';">
<strong>[${item.feedName}]</strong><br>
<a href="${item.link}" target="_blank">${item.title}</a><br>
<small>${item.pubDate.toLocaleString()}</small>
`;
if (returnElement) {
return itemDiv;
} else {
feedsContainer.appendChild(itemDiv);
}
}
function getFaviconDomain(feedName, feedLink) {
const feedObj = feeds.find(f => f.name === feedName);
if (feedObj && feedObj.favicon) {
return feedObj.favicon;
} else {
try {
const url = new URL(feedLink);
return url.hostname.replace(/^www\./, '');
} catch (e) {
return 'example.com';
}
}
}
function refreshFeeds() {
fetchFeeds();
}
function toggleTheme() {
document.body.classList.toggle('dark-mode');
}
function toggleArchive() {
showArchive = !showArchive;
renderFeeds();
}
function toggleGroup() {
groupByFeed = !groupByFeed;
renderFeeds();
}
function scrollToTop() {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
window.addEventListener('scroll', () => {
if (window.scrollY > 300) {
backToTopButton.style.display = 'block';
} else {
backToTopButton.style.display = 'none';
}
});
fetchFeeds();
</script>
</body>
</html>