( fork fromp https://github.com/dethos/worker-planet/ , only rss for now )
This project is meant to be an easy way to aggregate in a single page content from multiple sources. It takes a list of existing RSS feeds, aggregates their contents and displays them in chronological order.
It was inspired by other software packages such as Planet and MoonMoon but runs on top of Cloudflare Workers instead of being deployed on your own server.
This ends up being specially useful for communities, in order to follow the work being done and published by its members. Some examples of existing "planets" (but using different software):
Note: This project is still in its early days, so expect some rough edges. Any contributions are welcome.
- Clone this repository
- Install the project dependencies:
npm install - Create a
wrangler.tomlfile based on the existingwrangler.toml.example - Create KV namespaces and add their ids to the
kv_namespacessetting onwrangler.toml - Add your
account_idand customize all thevarsinwrangler.toml.FEEDSshould be a string of coma separated urls, to each of the RSS/ATOM sources that will be part of your planet. - Build the worker bundle:
npm run build - Deploy your new worker:
npm run deploy
Note: For the last step you might need to set the CLOUDFLARE_API_TOKEN environment variable.
- FEEDS - list of sources used to fetch the planet's content (separate each url with a comma)
- TITLE - Name of your planet (included in the generated html page and RSS feed)
- DESCRIPTION - Free text to be included on the page (currently not used on the included template)
- MAX_SIZE - Number of posts/entries that will be included on the page/feed
- CACHE_MAX_AGE - To avoid hitting the KV store each time the content is fetched, the static content is cached. You should adjust this value to the frequency you pick for your cron. Defined in seconds (default: 3600)
Each community has its own identity, so you should be able to easily customize the look and feel
of the generated page. To do so, before publishing you can edit one of the existing templates in the templates folder.
After, you should "precompile" that file using the following command:
$ npm run template -- templates/default.handlebars -f templates/default.precompiled.js
If the template name you are using is different from default, you should change the following 2 lines in index.js:
import template from './templates/default.precompiled'let template = Handlebars.templates['default']