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

Support for the google reader protocol #71

Open andreyorst opened 4 days ago

andreyorst commented 4 days ago

I'd like to propose an additional protocol.

I use FreshRSS, and while it works via Fever in elfeed-protocol, inability to sync the read state is bugging me quite a bit, because I usually read from my phone, so when I finally open my feeds in elfeed, I have a ton of old unread articles, that were actually read.

FreshRSS has a page about GoogleReader API:

https://freshrss.github.io/FreshRSS/en/developers/06_GoogleReader_API.html

As far as I can tell, GReader works better than Fever.

fasheng commented 3 days ago

You need a two-way synchronization protocol like ownCloud News although few people use it.

For Google Reader API, it's really special. It doesn't even have public documentation, everyone has different compatibility with it. After some verification work, looks that the two-way sync feature that you care about is not provided by Google Reader API, instead the clients did some workaround for it.

So this issue will be mark as "feature" and will continue to see if there is a need to implement it. However at least I will provide some builtin workaround code to sync unread stat like other clients did in the future.

Here is a simple code for fever:

(defun elfeed-protocol-fever-sync-unread-stat (host-url)
  "Set all entries in search view to read and fetch latest unread entries.
HOST-URL is the host name of Fever server with user field authentication info,
for example \"https://user@myhost.com\"."
  (mark-whole-buffer)
  (cl-loop for entry in (elfeed-search-selected)
           do (elfeed-untag-1 entry 'unread))
  (elfeed-protocol-fever--do-update host-url 'update-unread))

Reference: https://ash7.io/blog/hello-read-you-welcome-to-google-reader-api-en-us/ https://github.com/miniflux/v2/issues/2129 https://github.com/FreshRSS/FreshRSS/blob/edge/p/api/greader.php https://github.com/miniflux/v2/blob/main/internal/googlereader/handler.go

andreyorst commented 3 days ago

A few more notes on Google Reader API: https://feedhq.readthedocs.io/en/latest/api/index.html

andreyorst commented 3 days ago
(defun elfeed-protocol-fever-sync-unread-stat (host-url)
  "Set all entries in search view to read and fetch latest unread entries.
HOST-URL is the host name of Fever server with user field authentication info,
for example \"https://user@myhost.com\"."
  (interactive
   (list (completing-read
          "feed: "
          (mapcar (lambda (fd)
                    (string-trim-left (car fd) "[^+]*\\+"))
                  elfeed-protocol-feeds))))
  (save-mark-and-excursion
    (mark-whole-buffer)
    (cl-loop for entry in (elfeed-search-selected)
             do (elfeed-untag-1 entry 'unread))
    (elfeed-protocol-fever--do-update host-url 'update-unread)))

Made an interactive prompt for choosing a specific feed from protocol-feeds

andreyorst commented 3 days ago

You need a two-way synchronization protocol like ownCloud News although few people use it.

After some verification work, looks that the two-way sync feature that you care about is not provided by Google Reader API, instead the clients did some workaround for it.

Yeah, the client of my choice has this feature, so I assumed it was part of GReader protocol.

For Google Reader API, it's really special. It doesn't even have public documentation, everyone has different compatibility with it

I thought the API was thorley reverse-engineered, and well documented though unofficially. AFAICS it's one of the most widespread protocols, provided by a lot of services and used in a lot of clients.