How matias2018/simple-history-rss-reader works
Project type and purpose
• This is a single‐page, front-end JavaScript application (no custom back-end) whose sole responsibility is to fetch and display an RSS feed published by the Simple History WordPress plugin.
• The user opens a static HTML page (index.html), enters their RSS feed URL and secret, clicks “Fetch Feed,” and sees a list of feed items.
File structure
• Top‐level files:
• index.html – the UI shell
• script.js / script_simple.js – two variants of the main JavaScript logic
• styles.css – presentation layer
• logos/ – assets (favicon, manifest)
• README.md – documentation
• There are no server directories or back-end folders. This is a purely client-side app.
• No build scripts or config files—just static assets.
Key points from the README
• The app uses the browser’s Fetch API to call a CORS proxy (api.allorigins.win) which in turn retrieves the RSS XML from the WordPress site.
• It parses XML via DOMParser, extracts <item> elements, then renders title, description, and link into the page.
• Version 2 demonstrates modern JS features: optional chaining and nullish coalescing for safe extraction of tag content.
Main components and interactions
a. Browser / Client
• UI Layer (HTML + CSS)
• JavaScript Controller (script.js: event handlers, input fields, “Fetch Feed” button)
b. Fetch Module
• Constructs proxy URL: api.allorigins.win/get?url=<encoded-rss-url>
• Calls Fetch API → receives JSON with XML string
c. Parser Module
• DOMParser → converts XML string into Document
• Extracts <item> nodes
• For each item, reads title, description, link
d. Renderer Module
• Creates DOM elements (div, h2, p, a)
• Appends to the #rss-feed container
e. External Services
• CORS Proxy Service (api.allorigins.win)
• WordPress Site with Simple History Plugin RSS endpoint
Architectural patterns and design principles
• Separation of concerns:
• View (index.html + styles.css)
• Controller (script.js handles user events)
• Model parsing (Parser Module)
• Service layer (Fetch Module)
• SPA‐style flow: one page, dynamic content injection
• Medium‐trust boundary: all third-party CORS interactions go through a proxy