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] Custom titles for RSS feeds #13

Closed
vaygr opened this issue May 30, 2020 · 14 comments
Closed

[feature request] Custom titles for RSS feeds #13

vaygr opened this issue May 30, 2020 · 14 comments
Labels
enhancement New feature or request

Comments

@vaygr
Copy link

vaygr commented May 30, 2020

This looks like an underrated feature 🙂

It would be nice to have custom titles in the config overriding what's originally in the feed. Mostly for reasons to keep multiple resources consistent and clean for view.

@Lallassu Lallassu added the enhancement New feature or request label Jun 1, 2020
@shaneHowearth
Copy link

How would you want to tell the application of the name?

I was thinking that it could be in the config, where the URL to the feed had a name entry at one end (default to the existing name if it's not specified), which was stored in the Article (as 'DisplayName'?)

@vaygr
Copy link
Author

vaygr commented Jul 13, 2020

That's an option, yeah.

It could also be Newsboat-style: "https://domain.tld/url ~'Feed name'"

@shaneHowearth
Copy link

The could work, it's frowned upon for tildes to be in URLs so splitting on a tilde would be .. kind of safe?

I'll put a PR together over the next couple of days, that you can checkout and test?

@shaneHowearth
Copy link

@vaygr See #15

@kormoc
Copy link

kormoc commented Jul 14, 2020

Just a note, ~ has historically been used for a lot of urls, for example apache's UserDirs docs https://httpd.apache.org/docs/2.4/howto/public_html.html

http://example.com/~rbowen/file.html will be translated to the file path /var/www/rbowen/docs/file.html

While looking at alternative RSS readers, this caught my eye and I exported my list of feeds and 2 out of the 123 contained a ~ in the url. While this is a small number, it is used on some sites and historically was more widely used.

@shaneHowearth
Copy link

@kormoc That's a good point

It's trivial for me to choose the appropriate character to split on (there's two places it's specified - I could even make it a constant to make it easier to change)

Do you have a suggested delimiter? (do I have to write a regexp for " ~" (space tilde)

@kormoc
Copy link

kormoc commented Jul 14, 2020

I think my suggestion would be to delimit on ' ~ '

If a url has ' ~ ' in it, like http://example.com/foo ~ bar/file.html it would have to be encoded as http://example.com/foo%20~%20bar/file.html, which then would work for the delimiter

@shaneHowearth
Copy link

I think that will have to be documented

@Lallassu Should I make a documentation change with my PR?

@shaneHowearth
Copy link

@kormoc Oh, hrm, I couldn't "see" the spaces around the tilde in your comment - what if we said that tildes in URLS need to be encoded to %7E or %7e instead?

I cannot tests without an example of a feed with a tilde in the URL :(

@kormoc
Copy link

kormoc commented Jul 14, 2020

sadly the two feeds I use are private feeds :(

I think if you document it, it can work, however I think that given spaces already have to be encoded and tildes don't, that it's more user friendly to delimit on space tilde space or similar.

That said, this is just my $0.02 and it is likely not a overly used thing :)

@shaneHowearth
Copy link

@kormoc I think that, as things stand right now, my PR will break feeds for anyone that has a feed with a ~ within it, with those users not understanding that "it used to work". So, for backward compatibility, I think a space tilde is the right direction.

The natural inclination for me is to write a space then a ~between the URL and the optional name.

examples :

 "feeds": [
        "https://news.ycombinator.com/rss",
        "https://www.sweclockers.com/feeds/nyheter ~Swedish Overclocking",
        "https://www.reddit.com/r/homeassistant/.rss ~~Home Assistant~",
        "https://www.reddit.com/r/golang/.rss",
        "https://www.reddit.com/r/programming/.rss"
    ],

@Lallassu
Copy link
Owner

Perhaps since we are using json configuration marshaled into Go structs we could leverage this. So if the feeds are structured in the same way as for example customCommands we can have name and url pairs for each feed.

Example:

"feeds": [
     {
       "name": "Reddit - Home Assistant",
       "url": "https://www.reddit.com/r/homeassistant/.rss"
     }

Empty names would then use the default name as before. This way we don't get the "fuzziness" of using delimiters.

@shaneHowearth
Copy link

I've updated the PR

The example gorss.conf shows the allowable examples:
Users can have an array of strings (so, just URLS specified, existing style)
They can have an array of objects with name and url fields
They can have a mix of both (that's luck in the way that I did it, rather than a specific design goal)
@Lallassu @kormoc

@Lallassu
Copy link
Owner

Added in #15 by @shaneHowearth, Thanks and nice work @shaneHowearth!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants