-
Notifications
You must be signed in to change notification settings - Fork 1k
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
CSS Selector Bridge 2 #3626
CSS Selector Bridge 2 #3626
Conversation
Pull request artifacts
|
520dd5a
to
dda1b88
Compare
Looks nice! I designed the CSS Selector bridge to be as simple as possible because we can't address everything using a selector bridge: each site may have its little quirks requiring special handling, so CssSelectorBridge bridge was not designed to be a full replacement of the regular way of writing bridges in PHP, but rather a quick way of generating a feed for simple sites that don't have any specificity to take into account. Addressing everything may be frustrating and/or lead to feature bloat, difficulty to maintain the bridge to accommodate fixes for each user without breaking existing feeds. Note that if the site has a truncated RSS feed, you can use WordPressBridge to expand it and retain metadata such as author and timestamp from the feed. The site does not need to run WordPress for the bridge to work as you can specify a custom content selector if needed, so WordPressBridge should be preferred over CssSelectorBridge when possible. Now, let's assume that we still want to generate complex feeds using CSS Selectors anyway and not write a PHP bridge.
The CssSelector2Bridge looks nice as is, so you are not required to make further changes. I'm just making suggestions. |
Thanks for your detailed reply!
I agree there is something to say for keeping it more simple. I do think this will add valuable functionality, since the way to select content is more powerful.
I am not sure what you mean. I don't think I did anything to expand truncated feeds.
The website I was using to test this just required a cookie to enable loading the content. Just passing a cookie with a certain string would enable loading the content already. It didn't have to be valid. See issue #3612.
Good idea. I didn't feel like implementing it, but I can spend some time doing it.
True, but I don't think this is worth supporting right now.
Interesting, I didn't know that as I just starting using RSS. Do you recommend removing this feature?
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is some additional feedback about the code:
I meant, as a user, you may use WordPressBridge rather than CssSelectorBridge when the site has a truncated feed.
Oh, OK, got it. I did not see your issue, feel free to ping me whenever your issues are related to a bridge I maintain. This is rather strange, because the site may fail to be indexed properly in search engines if it does require a cookie.
No pressure 😉
Then welcome! Feel free to first test your feed with and without styling in your feed reader to see if that makes a difference, and decide based on your results. From my experience, I can just say that most bridges in rss-bridge will not clean style/class attributes from the HTML content, but all RSS readers I tried will just ignore them. |
I added the possibility to specify the time format. I also tested not removing the styling, but my own RSS Reader (NetNewsWire) did not ignore it and it caused a large amount of whitespace to be contained in the article, so I kept that functionality. |
@dvikan I am ready with the PR. |
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
find a less stupid name e.g. |
Done |
|
@dvikan Check your Author selector rss-bridge/bridges/CssSelectorComplexBridge.php Lines 424 to 427 in eb4ff70
|
please fix:
|
Hey maintainers,
I was working with the CSS Selector bridge, but I was missing some features. This is a pretty big change (breaking) in how the bridge works, so I made it CssSelector2Bridge.
It adds support for:
It works by this principle:
I made this because I found the original parser a bit too limited for my needs.