Comments (14)
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.
Added in #15 by @shaneHowearth, Thanks and nice work @shaneHowearth!
from gorss.
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.
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.
@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.
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.
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.
That's an option, yeah.
It could also be Newsboat-style: "https://domain.tld/url ~'Feed name'"
from gorss.
from gorss.
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.
@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.
I think that will have to be documented
@Lallassu Should I make a documentation change with my PR?
from gorss.
@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.
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)
- OPML Support? HOT 2
- [feature request] Non blocking feed update HOT 4
- [feature request] Search on keywords HOT 1
- Clean up downloading errors HOT 4
- Article highlighted is the index from the previous feed HOT 1
- Proposal: Ask before exit HOT 1
- Could you please use resolve default config path relative to `$XDG_CONFIG_HOME`? HOT 9
- Preview tab is not updated with next article when deleting the previous one HOT 1
- make all shouldn't depend on the `clean` target HOT 1
- Is there a way to use as a tool to merge multiple RSS feed sources? HOT 2
- Crashing on switching feeds HOT 1
- Request: Collapse (toggle) the feeds view
- Crash from UndoLastRead if nothing previously read HOT 1
- Only acts as client HOT 3
- Crashing on arm64 HOT 1
- add support for LSB ~/.config HOT 4
- Embed the themes into the binary with rice-go or go-bindata or similar HOT 2
- Use goreleaser to manage your releases and artefacts to Github releases
- unknown predefined entity HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorss.