Coder Social home page Coder Social logo

Comments (14)

Lallassu avatar Lallassu commented on August 25, 2024 2

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.

from gorss.

Lallassu avatar Lallassu commented on August 25, 2024 2

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024 1

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?

from gorss.

kormoc avatar kormoc commented on August 25, 2024 1

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024 1

@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"
    ],

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024 1

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024

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'?)

from gorss.

vaygr avatar vaygr commented on August 25, 2024

That's an option, yeah.

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024

@vaygr See #15

from gorss.

kormoc avatar kormoc commented on August 25, 2024

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.

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024

I think that will have to be documented

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

from gorss.

shaneHowearth avatar shaneHowearth commented on August 25, 2024

@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 :(

from gorss.

kormoc avatar kormoc commented on August 25, 2024

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

from gorss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.