Skip to content

[Sfeed] Added new format#3306

Merged
dvikan merged 3 commits intoRSS-Bridge:masterfrom
mad-reyk:master
Mar 11, 2023
Merged

[Sfeed] Added new format#3306
dvikan merged 3 commits intoRSS-Bridge:masterfrom
mad-reyk:master

Conversation

@mad-reyk
Copy link
Contributor

Sfeed is a simple feed format. Specification from sfeed(5) manual:

TAB-SEPARATED FORMAT FIELDS
     The items are output per line in a TAB-separated format.

     For the fields title, id and author each whitespace character is
     replaced by a SPACE character.  Control characters are removed.

     The content field can contain newlines and these are escaped.
     TABs, newlines and '\' are escaped with '\', so it becomes: '\t',
     '\n' and '\\'.  Other whitespace characters except spaces are
     removed.  Control characters are removed.

     The order and content of the fields are:

     1. timestamp     UNIX timestamp in UTC+0, empty if missing or on a
                      parse failure.

     2. title         Title text, HTML code in titles is ignored and is
                      treated as plain-text.

     3. link          Link

     4. content       Content, can have plain-text or HTML code
                      depending on the content-type field.

     5. content-type  "html" or "plain" if it has content.

     6. id            RSS item GUID or Atom id.

     7. author        Item, first author.

     8. enclosure     Item, first enclosure.

     9. category      Item, categories, multiple values are separated by
                      the '|' character.

Those who use sfeed and RSS-bridge can now view any feed directly
with no overhead. In fact sfeed(1) is so fast that it didn't change
anything, but now everything is architecturally correct.

Sfeed done homepage: https://codemadness.org/sfeed-simple-feed-parser.html
Sfeed toolbox Git repository: https://codemadness.org/git/sfeed/

This patch is used on my RSS-bridge instance: http://rss.madreyk.xyz/

@@ -0,0 +1,53 @@
<?PHP
function escape(string $str) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these global functions to class.

@dvikan dvikan merged commit c1f446f into RSS-Bridge:master Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants