fasheng / elfeed-protocol

Provide extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
GNU General Public License v3.0
100 stars 18 forks source link

Feed url of subfeeds e.g. owncloud elfeed-autotag elfeed-summary #63

Closed Thaodan closed 1 year ago

Thaodan commented 1 year ago

How could the feed url set to the url of the subfeeds that are fetched from services such as e.g. owncloud news?

fasheng commented 1 year ago

elfeed-protocol use feed id instead of feed url, for example owncloud+http://user@myhost.com::http://example.com/rss: https://github.com/fasheng/elfeed-protocol/blob/master/elfeed-protocol-common.el#L87 https://github.com/fasheng/elfeed-protocol/blob/master/elfeed-protocol-owncloud.el#L125

Thaodan commented 1 year ago

Is the feed-url set to feeds of the owncloud instance?

Thaodan commented 1 year ago

I think they are, I think in my case elfeed-autotag didn't work correctly, I assumed it was because feed-url is set to the owncloud instance feed url.

fasheng commented 1 year ago

Do you mean https://github.com/paulelms/elfeed-autotag ? I don't know it before, I used defadvice + elfeed-org from the beginning. And looks elfeed-autotag try to make elfeed-org work with elfeed-protocol, too. Well, I'm not sure, hope elfeed-autotag works well.

Yes, I use format like owncloud+http://user@myhost.com::http://example.com/rss as feed-url, which contains service information(I call it PROTO-ID) as prefix.

Thaodan commented 1 year ago

Thanks. Related to this how does elfeed protocol work compared to other news sources? I have an issue that either elfeed-autotag doesn't work or the new entry hook is not triggered when I fetch news?

fasheng commented 1 year ago

You should report your problem at first.

However I don't use elfeed-autotag, I'm not sure if it cause the problem. I use defadvice + elfeed-org instead: https://github.com/fasheng/elfeed-protocol#work-with-elfeed-org

And Which hook not work, elfeed-new-entry-parse-hook or elfeed-update-hooks? The code is here: https://github.com/fasheng/elfeed-protocol/blob/6789e1e5e40bcd5562e889d0bf5f54e6c0090e50/elfeed-protocol-owncloud.el#L268-L269 https://github.com/fasheng/elfeed-protocol/blob/6789e1e5e40bcd5562e889d0bf5f54e6c0090e50/elfeed-protocol-owncloud.el#L340

Thaodan commented 1 year ago

Does devadvice + elfeed-org work the same way as elfeed-autotag with elfeed protocol?

The elfeed-new-entry-hook that is used by elfeed-autotag doesn't work.

fasheng commented 1 year ago

Well, I don't know elfeed-autotag before. After briefly browsing its code, I don't think so.

You should check if elfeed-autotag caused your elfeed-new-entry-hook issue in next step, that's the point. If so, elfeed-autotag's author should know more about it.

fasheng commented 1 year ago

And please try to check if devadvice + elfeed-org caused the hook issue, too.

Thaodan commented 1 year ago

The issue is that I was using elfeed-summary. To explain: elfeed-autotag adds an advice around elfeed to load it's rules. But using elfeed-summary this function is never called, the advice also has to be added to elfeed-summary-update and elfeed-update so it is ensured that the rules are always loaded and up to date.

I assume the issue is an chicken and egg issue. Before elfeed-autotag can run the rules have to be loaded but the elfeed-new-entry hook would be to early for doing so.

fasheng commented 1 year ago

Well, you provide a new package elfeed-summary again...

So your ensure that elfeed-summary caused your problem instead of elfeed-autotag, right?

After trying for 15 minutes. The result is elfeed-summary could not work together with both elfeed-org and elfeed-protocol(I use elfeed-org instead of elfeed-autotag). Hope someone provide PR to fix this for elfeed-summary in the future. And now, I'm afraid you must hack the code yourself.

BTW: If there is enough time, I will provide some code later.

Thaodan commented 1 year ago

Well, you provide a new package elfeed-summary again...

I didn't thought it would matter as it just calls elfeed but it did in the end.

How did elfeed-summary not work with elfeed-protocol for you? For me it works except that :misc selector doesn't work.

You should add a add-advice to elfeed-summary or elfeed-summary-update to work with elfeed-org similar as you do for plain elfeed as the elfeed function is never called using elfeed-summar (elfeed calls elfeed-search to show news and doesn't call the elfeed wrapper that calls later elfeed-search).

fasheng commented 1 year ago

@Thaodan I guess you are confused by elfeed-summary. With the default elfeed-summary-settings value, the All feeds section will only one elfeed-protocol style feed, for example fever+https://user@your-host.com. And elfeed-summary-update will report error:

elfeed-summary--feed-list: ‘elfeed-feeds’ malformed, bad entry: ("fever+https://user@your-host.com"...

Maybe there are feeds that defined in elfeed-org under All feeds section which looks correctly, however it means elfeed-summary called elfeed-org's function, and the elfeed-feeds already been modified by elfeed-org, so elfeed-protocol will be just ignored. You could see the updated entries, but it has nothing to do with elfeed-protocol!

Besides, for elfeed-summary-update update feeds in its own way, it's hard to provide a simple defadvice like elfeed-org for it. I don't know why it not call elfeed-update instead, maybe just want to trace the updating process.

A simple workaround is query elfeed-db-feeds and append the elfeed-protocol feeds to elfeed-summary-settings manually.

I'm really don't know which package caused your new-entry-hook issue. If there is any progress later, I will report here. Hope helps.

Thaodan commented 1 year ago

I don't know about your settings but for me with the default settings of elfeed-summary-settings I can select All Feeds without errors, the only thing that doesn't work is the counter that shows 0/0 even thou there are news inside the feed.

Updating the feeds works to. The use a wrapper because elfeed doesn't tell when the update is done, see the comments inside elfeed-summary.

Not sure if the different elfeed-procotol backend makes a difference.

I'm not using elfeed-org but I think the issue was caused by the activation of elfeed-org or elfeed-autotag not working when the function elfeed isn't called.

fasheng commented 1 year ago

@Thaodan Hi, I released a new version 0.9.0 just now, it should solve most of your problems.

elfeed-protocol now use variable elfeed-protocol-feeds instead of elfeed-feeds, then it will work together with elfeed-org without any additional configuration.

To work with elfeed-summary, here is a simple workaround: https://github.com/fasheng/elfeed-protocol#work-with-elfeed-summary

Thaodan commented 1 year ago

Did you check elfeed-summary? It uses elfeed-protocol in multiple instances. Using a non-standard variable to list feeds doesn't work unless you would populate those feeds with the feeds url's returned by that backend.

You workaroud elfeed-summary-update breaking by using elfeed-update which makes the update of the summary not work before it is refreshed.

The next feature that breaks is fetching only feeds that contain but I assume that only is an issue when using other sources besides elfeed-protcol feeds.

The :misc selector doesn't work completely now as elfeed-protocol is empty. Before it also did show 0/0 and the elfeed-protocol source.

The workaround to fix 0/0 on all feeds you show, doesn't work for eleed-autotag. I assume it is similar to why the :misc selector doesn't work.

fasheng commented 1 year ago
  1. Both elfeed-org and elfeed-autotag will provide autotags feature for elfeed-protocl without any additional setup, and both working fine here
  2. elfeed-summary requres elfeed-org, so in my option, you don't need elfeed-autotag any more
  3. It's hard to hack the code to make all features of elfeed-summary works. The simple advice only solve 0/0 issue, you can press r the refresh the UI manually after elfeed-update, or append the code to related elfeed hook. In fact, I use run-at-time to call elfeed-update in background automatically, so elfeed-summary show the unread/total count and provide easy way to filter each feed is enough for me. What new discoveries will be made in the future will be left behind.
fasheng commented 1 year ago

And :misc works here with the following config:

(setq elfeed-summary-settings
  '((group (:title . "News")
           (:elements
            (query . news)))
    (group (:title . "Misc feeds")
           (:elements :misc))))