Skip to content

Commit ce00abb

Browse files
slarsonclaude
andcommitted
Revive Tumblr RSS feed integration on homepage and news page
- Fixed broken news feed on homepage (Google Feed API deprecated in 2016) - Replaced PaRSS/Google Feed API with modern allOrigins CORS proxy - Homepage: Shows 6 latest post titles from Tumblr - News page: Completely rebuilt to dynamically show 25 posts with full content - Eliminated redundancy: Tumblr is now single source of truth for news - Backed up old static news.html to news.html.backup Both pages now pull live from https://openworm.tumblr.com/rss allOrigins CORS proxy is free and open source (no API key required) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
1 parent ce4cfa2 commit ce00abb

3 files changed

Lines changed: 447 additions & 264 deletions

File tree

js/main.js

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,43 @@ function setNavigation() {
128128

129129

130130
function refreshNews() {
131-
$("#news-feed").PaRSS("https://openworm.tumblr.com/rss", // url to the feed
132-
6, // number of items to retrieve
133-
"M jS Y, g:i a", // date format
134-
false, // include descriptions
135-
function() {
136-
// optional callback function
137-
})
131+
// Use allOrigins CORS proxy to fetch Tumblr RSS
132+
$.ajax({
133+
url: 'https://api.allorigins.win/get?url=' + encodeURIComponent('https://openworm.tumblr.com/rss'),
134+
method: 'GET',
135+
dataType: 'json',
136+
success: function(data) {
137+
var parser = new DOMParser();
138+
var xml = parser.parseFromString(data.contents, 'text/xml');
139+
var items = xml.querySelectorAll('item');
140+
141+
var html = '';
142+
var count = 0;
143+
items.forEach(function(item) {
144+
if (count >= 6) return;
145+
146+
var title = item.querySelector('title').textContent;
147+
var link = item.querySelector('link').textContent;
148+
var pubDate = new Date(item.querySelector('pubDate').textContent);
149+
var dateStr = pubDate.toLocaleDateString('en-US', {
150+
month: 'short',
151+
day: 'numeric',
152+
year: 'numeric'
153+
});
154+
155+
html += '<li>';
156+
html += '<a href="' + link + '" target="_blank">' + title + '</a>';
157+
html += ' <span class="muted">(' + dateStr + ')</span>';
158+
html += '</li>';
159+
count++;
160+
});
161+
$("#news-feed").html(html);
162+
},
163+
error: function(err) {
164+
console.error('Error loading news feed:', err);
165+
$("#news-feed").html('<li class="muted">Unable to load news feed.</li>');
166+
}
167+
});
138168
}
139169

140170

0 commit comments

Comments
 (0)