GithubHelp home page GithubHelp logo

dethos / worker-planet Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 3.0 182 KB

Generate a single page (and feed) with content from multiple RSS/Atom sources. Runs on Cloudflare Workers.

License: GNU Affero General Public License v3.0

JavaScript 48.52% Handlebars 51.48%
planet rss worker-planet rss-feed cloudflare-workers cloudflare hacktoberfest

worker-planet's Introduction

Worker-planet

This project is meant to be an easy way to aggregate, on 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 especially useful for communities to follow the work being done and published by their members.

Below are some examples of existing "planets" that use different software:

An example of a live planet using worker-planet software is:

If you wish to add your deployment to this list, feel free to create a PR.

How to deploy

  1. Clone this repository.
  2. Install the project dependencies: npm install.
  3. Create a wrangler.toml file based on the existing wrangler.toml.example.
  4. Create KV namespaces and add their IDs to the kv_namespaces setting on wrangler.toml.
  5. Add your account_id and customize all the vars in wrangler.toml. FEEDS should be a string of comma-separated URLs, one for each of the RSS/ATOM sources that will be part of your planet.
  6. Build the worker bundle: npm run build.
  7. Deploy your new worker: npm run deploy.

Note: For the last step, you might need to set the CLOUDFLARE_API_TOKEN environment variable.

Configuration variables

  • 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)

Customize the generated HTML

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 that, 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']

worker-planet's People

Contributors

dependabot[bot] avatar dethos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

worker-planet's Issues

cant get it to run

  Uncaught TypeError: globalThis.XMLHttpRequest is not a constructor
    at null.<anonymous>
  (file:///home/someone/foobar/node_modules/rollup-plugin-node-polyfills/polyfills/http-lib/capability.js:20:11)
  in checkTypeSupport
    at null.<anonymous>
  (file:///home/someone/foobar/node_modules/rollup-plugin-node-polyfills/polyfills/http-lib/capability.js:39:45)
  in node_modules/rollup-plugin-node-polyfills/polyfills/http-lib/capability.js
    at null.<anonymous> (worker.js:9:58) in __init
    at null.<anonymous>
  (file:///home/someone/foobar/node_modules/rollup-plugin-node-polyfills/polyfills/http-lib/request.js:1:1)
  in node_modules/rollup-plugin-node-polyfills/po

even upgrading node modules did not help
and https://github.com/apacheli/web-workers-polyfill also refused to work ( or my skills are not on that level to implement it )

ty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.