update readme for clarity, Create LICENSE

This commit is contained in:
Jasmine Amalia 2023-10-18 18:17:20 +07:00 committed by Jasmine Amalia
parent d785d9e142
commit 532dc2ef7f
Signed by untrusted user who does not match committer: jasm1nii
GPG Key ID: 9C88CED5BF43BD08
2 changed files with 37 additions and 7 deletions

32
LICENSE Normal file
View File

@ -0,0 +1,32 @@
(tbh as long as it's for personal use, i Do Not care if you include this)
---
BSD 3-Clause License
Copyright (c) 2023, Jasmine Amalia
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -6,19 +6,19 @@ an RSS/atom feed generator for my personal site :cat: tested to work with PHP ve
## how it works
1. match files in a specificied directory.
2. load the DOM of each file.
3. parse the following elements as children of `<entry>`, in order of priority:
3. for each child of `<entry>` in the XML feed, output a string value from one of the following HTML elements/file properties, in order of priority:
| original HTML | feed output |
| original HTML | XML output |
|-------------------------------|---------------------------------|
| 1. `class="p-name"` | `<title>` |
| 2. `<title>` in `<head>` | |
| 3. the XML feed title | |
| | |
| 1. `datetime` attribute of `class=dt-updated` | `<updated>` |
| 1. `datetime` attribute of `class="dt-updated"` | `<updated>` |
| 2. `datetime` attribute of the first `<time>` element | |
| 3. file modification date, retrieved from the server | |
| | |
| 1. `datetime` attribute of `class=dt-published` | `<published>` |
| 1. `datetime` attribute of `class="dt-published"` | `<published>` |
| 2. `datetime` attribute of the first `<time>` element | |
| 3. file creation date, retrieved from the server | |
| | |
@ -32,7 +32,7 @@ an RSS/atom feed generator for my personal site :cat: tested to work with PHP ve
4. output all of the above into a new file named **articles.xml** (default name, but can be changed).
4. save all of the above into a new file named **articles.xml** (default name, but can be changed).
## ways to use
- configure a cron job on your web server to run automatically every now and then.
@ -43,8 +43,6 @@ 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).
---
## example output
feel free to check out [the resulting file](https://jasm1nii.xyz/blog/articles/articles.xml) that i've generated.