From eee6415633f6e7edf3e0dc4c472d415580949530 Mon Sep 17 00:00:00 2001 From: Jasmine Amalia Date: Wed, 18 Oct 2023 14:03:14 +0700 Subject: [PATCH] Update README.md --- README.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 171c5b6..e10980c 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,36 @@ an RSS/atom feed generator for my personal site :cat: --- ## disclaimer -### this script is not meant to be used as is. -expect to do *a lot* of modification to fit your needs, as this was created specifically for my site structure and blog markup. +**this script is not meant to be used as is (yet).** + +expect to do *a lot* of modification to fit your needs, as this was originally tailored for my site structure and blog markup. --- -## how it basically works +## how it works 1. match files in a specificied directory. 2. load the DOM of each file. -3. parse values retrieved from the following strings/HTML elements, as children of a feed ``: - - `

` as `` - - the `datetime` attribute of `<time>` as `<updated>` +3. parse values retrieved from the following strings/HTML elements (prioritizing [h-entry markup](https://microformats.org/wiki/h-entry)), as children of a feed `<entry>`: + - `<element class=p-name>` (or `<h2>`) as `<title>` + - the `datetime` attribute of `<time>` (or the file creation date) as `<updated>` - `<element class="p-summary">` as `<summary>` - - `<element class="e-content">` (or `<element class="entry"` for older markup) as `<content>` - - `/path/to/blog/entry` as `<id>`/`<link>` -4. output all of the above in a new file (named `articles.xml`). + - `<element class="e-content">` (or `<article>`) as `<content>` + - `/path/to/blog/entry` as `<id>` and `<link>` +4. output all of the above into a new file named **articles.xml**. + +## ways to use +- configure a cron job on your web server to run automatically every now and then. + - if you manage your site with cPanel, [here's how to do that](https://docs.cpanel.net/cpanel/advanced/cron-jobs/). + +or + +- run the script locally on your machine. + - you can open the file on a local server like [five server](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) for vscode or [XAMPP](https://www.apachefriends.org/index.html). --- -## usage -configure a cron job on your server to run this script automatically every now and then, and voila~ - ---- - -## reference +## example output feel free to check out [the resulting file](https://jasm1nii.xyz/blog/articles/articles.xml) that i've generated. + +## alternatives +- [cjwainwright/FeedGenerator](https://github.com/cjwainwright/FeedGenerator)