Skip to content

OPML export/import of some proprietary FreshRSS attributes#4342

Merged
Alkarex merged 5 commits intoFreshRSS:edgefrom
Alkarex:opml-namespace
May 12, 2022
Merged

OPML export/import of some proprietary FreshRSS attributes#4342
Alkarex merged 5 commits intoFreshRSS:edgefrom
Alkarex:opml-namespace

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented May 2, 2022

#fix #4077
And one of the TODOs of #4220
So far: XPath options, CSS Selector, and action filters:

<outline xmlns:frss="https://freshrss.org/#v1"
  text="Example"
  type="HTML+XPath"
  xmlUrl="https://www.example.net/page.html"
  htmlUrl="https://www.example.net/page.html"
  description="Example of Web scraping"
  frss:xPathItem="//a[contains(@href, '/interesting/')]/ancestor::article"
  frss:xPathItemTitle="descendant::h2"
  frss:xPathItemContent="."
  frss:xPathItemUri="descendant::a[string-length(@href)&gt;0]/@href"
  frss:xPathItemThumbnail="descendant::img/@src"
  frss:cssFullContent="article"
  frss:filtersActionRead="intitle:⚡️ OR intitle:🔥&#10;something"
/>

I do not believe we should export everything in OPML, but those attributes at least make sense.

Relevant parts of the OPML specification:

An OPML file may contain elements and attributes not described on this page, only if those elements are defined in a namespace

OPML can also be extended by the addition of new values for the type attribute

Notes: Modifies the lib_opml library to support (basic) XML namespaces. Like previous PRs such as #1112 , #1206 , but the library has been archived so my upstream issues / PRs are not visible anymore. The author of lib_opml ( @marienfressinaud ) wrote:

After (too) many years, I'm going to clean the lib_opml code and "end" it (there's nothing to add until the spec changes)

Alkarex added 2 commits May 2, 2022 14:57
#fix FreshRSS#4077
And one of the TODOs of FreshRSS#4220
XPath options, CSS Selector, and action filters
/** @var FreshRSS_TagDAO */
private $tag_dao;

const FRSS_NAMESPACE = 'https://freshrss.org/#v1';
Copy link
Member Author

@Alkarex Alkarex May 2, 2022

Choose a reason for hiding this comment

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

@marienfressinaud Any comment? :-)
(I would suggest a redirect to a documentation page)
Alternatives include http://purl.org , maybe http://xmlns.com / http://opml.org (more ambitious), or a non-URL URI

Copy link
Member

Choose a reason for hiding this comment

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

https://freshrss.org/opml ? (I will not be able to redirect the #v1 hash)

Copy link
Member Author

Choose a reason for hiding this comment

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

https://freshrss.org/opml looks good @marienfressinaud :-)
(Of course for #v1 but it was to avoid introducing a non-working URL so far)

Copy link
Member

Choose a reason for hiding this comment

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

Ok, let me know when the documentation page is ready, I'll do the redirection then

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Done! https://freshrss.org/opml (code 302 for now)

Copy link
Member Author

Choose a reason for hiding this comment

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

Super 👍🏻

@marienfressinaud
Copy link
Member

To be clearer, I continue the work at https://framagit.org/marienfressinaud/lib_opml and I'm currently improving the support for special attributes (cf. https://framagit.org/marienfressinaud/lib_opml/-/merge_requests/16). Since it's not finished yet, I still can add the support for custom namespaces :)

@Alkarex Alkarex merged commit 4a87206 into FreshRSS:edge May 12, 2022
@Alkarex Alkarex deleted the opml-namespace branch May 12, 2022 20:15
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.

[BUG] Advanced option like "Filter actions" are not saved using the export option to fully migrate a configuration

2 participants