When I announced @AusGLAMBlogs to the world, a few people asked if they could get the list of blog feeds I was using. At the time, I didn't have an easy and sustainable way to do this. I was also too busy writing a conference paper to devote time to it.
Firstly we need to create a new file to store all our blog feeds. We strip out all the quote marks and commas, and separate each feed with a new line:
https://www.hughrundle.net/rss http://secondblog.com/feed http://theoneafterthat.com/rss
Then save it in the same directory as the main file, as
Back the main js file, we need to
require a new package called 'fs'. This is a standard nodejs package that allows you to interact with other files on the server:
var FeedParser = require('feedparser'), request = require('request'), fs = require('fs');
Then replace the old array with a new line:
var feeds = fs.readFileSync('feeds.txt').toString().split('\n');
This takes the
The end result is the same as what we had before, but now we can simply add a new line to the feeds.txt file whenver we want to add a new feed, and anyone can easily find the list of feeds from that file.
You can find both files at the project page on GitLab. Please let me know if there are any Australian GLAM blogs you like that are not on the list.