Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPML to get all feeds of all categories #436

Open
1 of 3 tasks
sjehuda opened this issue Apr 18, 2024 · 5 comments
Open
1 of 3 tasks

OPML to get all feeds of all categories #436

sjehuda opened this issue Apr 18, 2024 · 5 comments

Comments

@sjehuda
Copy link

sjehuda commented Apr 18, 2024

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)
  • 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

@Kwpolska
Copy link
Member

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.

@sjehuda sjehuda changed the title Feeds for categories/tags and OPML to get all feeds OPML to get all feeds of all categories Apr 18, 2024
@sjehuda
Copy link
Author

sjehuda commented Apr 18, 2024

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?

@Kwpolska
Copy link
Member

I think OPML should be a plugin.

@sjehuda
Copy link
Author

sjehuda commented Apr 29, 2024 via email

@Kwpolska Kwpolska transferred this issue from getnikola/nikola Apr 29, 2024
@Kwpolska
Copy link
Member

Moved.

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

No branches or pull requests

2 participants