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

Feature Request: File/ImportSubscriptions from an OPML URL as (insert new folder name here) #4506

Open
drf5n opened this issue Jan 29, 2025 · 4 comments

Comments

@drf5n
Copy link

drf5n commented Jan 29, 2025

I was playing with the File/Import Subscriptions item, and it works just fine from a file.

As-is, NetNewsWire seems to import an OPML file with the foldername derived from the outline:title field. two distinct files from separate sources have the same title, it will merge them in NetNewsWire. You can work around that by editing the OPML files to use different titles.

Two things might be nice:

  1. Add a mechanism to override the folder name in the OPML file with a chosen name.
  2. Add a mechanism to paste in a URL instead of loading a local file.

These two changes would make it easier to sort of manually subscribe to other folk's OPML files with control of your own folder name space.

If you want to update your copy of someone's feed, you would re-import again with the chosen name, and it merges in the new feeds. To flush out any dropped feeds, delete the folder and re-import, and NNW remembers all the already-seen feeds.

Oh, a third thing -- if you happen to drag-and-drop a URL into NNW and it tries to make a feed, but fails because you dropped in a URL to a subscription OPML file, import it as a subscription file.

@drf5n drf5n changed the title File/ImportSubscriptions from an OPML URL as (insert new folder name here) Feature Request: File/ImportSubscriptions from an OPML URL as (insert new folder name here) Jan 29, 2025
@drf5n
Copy link
Author

drf5n commented Jan 30, 2025

Here's a python script to parse an URL and write it as a file with an edited title for NNW importing:

#!/usr/bin/python3

import requests
import xml.etree.ElementTree as ET
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("url",help="OPML URL",default="http://insert.your/feed/here.xml")
parser.add_argument("-t","--title",help="outline title ",default="00_junk_folder")
parser.add_argument("-o","--output",help="output file ",default="00_junk_folder.xml")

path = ".//outline"

args=parser.parse_args()

response = requests.get(args.url)
tree = ET.ElementTree(ET.fromstring(response.content)) # tricky -- promote an element to an ElementTree

topOutline = tree.find(path)
topOutline.set('title', args.title)
print(ET.tostring(topOutline))

tree.write(args.output,encoding="utf-8")

With this, one could script a couple OPMLs into local files with controlled titles for importing into NNW

@brentsimmons
Copy link
Collaborator

You can also create multiple On My Mac accounts and give them different names and import a different OPML file into each.

@drf5n
Copy link
Author

drf5n commented Jan 30, 2025

Oh, under NetNewsWire/Settings/Account -- This 20yr user does not remember exploring the Accounts tab.

@drf5n
Copy link
Author

drf5n commented Feb 6, 2025

I see: "Make Import OPML from URL work" #136

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