plugins icon indicating copy to clipboard operation
plugins copied to clipboard

OPML to get all feeds of all categories

Open sjehuda opened this issue 1 year ago • 5 comments

Requested Feature: (short description)

It would be good to have feed per tag, and generate an OPML file to download all at once for easy import into feed readers.

Related Area: (eg. tasks, compilers, configuration, templates…)

I think template.

Do you want to contribute this yourself as a pull request? (don’t worry about it if you don’t want to/can’t — someone else can take care of it)

  • [ ] Yes, I have already written code for it (link if available and feasible)
  • [x] Yes, I don’t have code ready yet (that’s okay!)
  • [ ] No (that’s okay too!)

Does this feature affect backwards compatibility? If yes, in what way?

No

Rationale and full description: (why should it be added to Nikola?)

Some people would want to get information on a specific matter.

For instance, not all news of WebXDC may be relevant and Game developers would want to get WebXDC news concerning to games.

OPML

OPML can be used to download a collection of feeds at once.

As I did not find an OPML generator, I have wrote my own one:

def export_to_opml(jid, filename, results):
    print(jid, filename, results)
    function_name = sys._getframe().f_code.co_name
    logger.debug('{} jid: {} filename: {}'
                .format(function_name, jid, filename))
    root = ETR.Element("opml")
    root.set("version", "1.0")
    head = ETR.SubElement(root, "head")
    ETR.SubElement(head, "title").text = "{}".format(jid)
    ETR.SubElement(head, "description").text = (
        "Set of subscriptions exported by Slixfeed")
    ETR.SubElement(head, "generator").text = "Nikola"
    ETR.SubElement(head, "urlPublic").text = (
        "https://getnikola.com/")
    time_stamp = dt.current_time()
    ETR.SubElement(head, "dateCreated").text = time_stamp
    ETR.SubElement(head, "dateModified").text = time_stamp
    body = ETR.SubElement(root, "body")
    for result in results:
        outline = ETR.SubElement(body, "outline")
        outline.set("text", result[1])
        outline.set("xmlUrl", result[2])
        # outline.set("type", result[2])
    tree = ETR.ElementTree(root)
    tree.write(filename)

Source: https://gitgud.io/sjehuda/slixfeed/-/raw/master/slixfeed/action.py?ref_type=heads

sjehuda avatar Apr 18 '24 14:04 sjehuda

Feeds for categories/tags

Already exists: https://getnikola.com/categories/nikola.xml

Atom should work too, but it’s not enabled on getnikola.com.

OPML to get all feeds

This would be OK. Shouldn’t be too hard to implement if we would only have tags and categories in there.

Kwpolska avatar Apr 18 '24 16:04 Kwpolska

Already exists: https://getnikola.com/categories/nikola.xml

Thank you. Title has been changed accordingly.

This would be OK. Shouldn’t be too hard to implement if we would only have tags and categories in there.

Do you want OPML to be in core?

If you do, since an Atom generation is within nikola.py shall we move it and OPML to syndication.py module?

sjehuda avatar Apr 18 '24 17:04 sjehuda

I think OPML should be a plugin.

Kwpolska avatar Apr 29 '24 12:04 Kwpolska

Can we move this to plugins issue tracker?

sjehuda avatar Apr 29 '24 18:04 sjehuda

Moved.

Kwpolska avatar Apr 29 '24 18:04 Kwpolska