Provide extra protocols to make like ownCloud News, Tiny Tiny RSS and NewsBlur works with elfeed
Clone or download

README.md

elfeed-protocol

MELPA MELPA Stable

Provide extra protocols to make self-hosting RSS readers works with elfeed, including Nextcloud/ownCloud News, Tiny Tiny RSS, NewsBlur and even more.

Installation through MELPA

;; Install through package manager
M-x package-install <ENTER>
elfeed-protocol <ENTER>

Initialization

Setup elfeed-protocol, then switch to search view and and press G to update entries:

;; curl recommend
(setq elfeed-use-curl t)
(elfeed-set-timeout 36000)
(setq elfeed-curl-extra-arguments '("--insecure")) ;necessary for https without a trust certificate

;; setup extra protocol feeds
(setq elfeed-feeds '(
                     ;; format 1
                     "owncloud+https://user1:pass1@myhost.com"

                     ;; format 2, for password with special characters
                     ("owncloud+https://user2@myhost.com"
                      :password "password/with|special@characters:")

                     ;; format 3, for password in file
                     ("owncloud+https://user3@myhost.com"
                      :password-file "~/.password")

                     ;; format 4, for password in .authinfo, ensure (auth-source-search :host "myhost.com" :port "443" :user "user4") exists
                     ("owncloud+https://user4@myhost.com"
                      :use-authinfo t)

                     ;; format 5, for password in gnome-keyring
                     ("owncloud+https://user5@myhost.com"
                      :password (shell-command-to-string "secret-tool lookup attribute value"))

                     ;; format 5, for password in pass(1), using password-store.el
                     ("owncloud+https://user5@myhost.com"
                      :password (password-store-get "owncloud/app-pass"))

                     ;; use autotags
                     ("owncloud+https://user6@myhost.com"
                      :password "password"
                      :autotags '(("example.com" comic)))))
(elfeed-protocol-enable)

To make elfeed-org tag rules works together with elfeed-protocol, just add a after advice for elfeed:

(defadvice elfeed (after configure-elfeed-feeds activate)
  "Make elfeed-org autotags rules works with elfeed-protocol."
  (setq elfeed-protocol-tags elfeed-feeds)
  (setq elfeed-feeds (list
                      (list "owncloud+https://user@myhost.com"
                            :password '(password-store-get "owncloud/app-pass")
                            :autotags elfeed-protocol-tags))))

Protocol Details

owncloud (ownCloud News)

  1. Fetch articles by the modified time
  2. Support sync unread and starred tags, the starred tag name defined in elfeed-protocol-owncloud-star-tag which default value is star. For example, if user add star tag to one article, the star stat will be sync to server, too

Example:

(setq elfeed-feeds (list
                    "owncloud+https://user1:pass1@myhost.com"
                    (list "owncloud+https://user2@myhost.com"
                          :password "password/with|special@characters:"
                          :autotags '(("example.com" comic)))))

ttrss (Tiny Tiny RSS, requires version: 1.7.6)

  1. Fetch articles by the entry ID
  2. Fetch tags in remote
  3. Support sync unread, starred and published tags, the starred tag name defined in elfeed-protocol-ttrss-star-tag which default value is star, and the published tag name defined in elfeed-protocol-ttrss-publish-tag which default value is publish

Example:

(setq elfeed-feeds (list
                    "ttrss+https://user1:pass1@myhost.com"
                    (list "ttrss+https://user2@myhost.com"
                          :password "password/with|special@characters:"
                          :autotags '(("example.com" comic)))))

newsblur (NewsBlur)

  1. Fetch articles from recent pages
  2. Fetch tags in remote
  3. Support sync unread, starred(saved) tags, the starred tag name defined in elfeed-protocol-ttrss-star-tag which default value is star

NOTE: For elfeed don't provide cookie argument for curl request, user must setup elfeed-curl-extra-arguments like the following example.

Example:

(setq elfeed-curl-extra-arguments '("-c" "/tmp/newsblur-cookie"
                                    "-b" "/tmp/newsblur-cookie"))
(setq elfeed-feeds (list
                    "newsblur+https://user1:pass1@newsblur.com"
                    (list "newsblur+https://user2@newsblur.com"
                          :password "password/with|special@characters:"
                          :autotags '(("example.com" comic)))))

Run Unit-Tests

Install cask system package firstly, and then run following commands

make init
make test
make checkdoc
make elint
make package-lint

Deploy Services for Testing

Nextcloud/ownCloud News

  1. Fetch docker image and run it

    docker pull nextcloud
    docker run --rm -p 80:80 nextcloud
    
  2. Open http://127.0.0.1 in browser to setup Nextcloud

    1. Create admin user and select database to SQLite, then press "Finish setup"
    2. Press left top popup menu and select "+Apps", select "Multimedia", and enable the "News" app
    3. Press left top popup menu and switch to "News" app, then subscribe some feeds
  3. Setup elfeed-protocol

    (setq elfeed-feeds '("owncloud+http://<admin>:<password>@localhost"))

Tiny Tiny RSS

  1. Fetch related docker images and run them

    docker pull clue/ttrss
    docker pull nornagon/postgres
    docker run --rm -d --name ttrssdb nornagon/postgres
    docker run --rm --link ttrssdb:db -p 80:80 clue/ttrss
    
  2. Open http://127.0.0.1 in browser to setup Tiny Tiny RSS

    1. Use the default admin:password authorization info to login
    2. Enter "Preferences" page to enable "Enable API access" and save configuration
  3. Setup elfeed-protocol

    (setq elfeed-feeds '("ttrss+http://admin:password@localhost"))

Problems

  1. Sometimes emacs may be blocked if the parsing downloaded articles is too large, for example >50MB. This is caused by the known emacs bug that CPU will be in high usage if a text line is too long. There three methods to workaround this:
    1. Method 1, limit the download size, for example:

      (setq elfeed-protocol-owncloud-maxsize 1000)
      
    2. Method 2, for ownCloud, just update articles since special entry ID instead the modified time, this could run multiple times to keep up to date to avoid download too large entries once time

      M-x elfeed-protocol-owncloud-update-since-id
      
    3. Method 3, some protocol provide update method to reset the last modified time to skip some data, for example:

      M-x elfeed-protocol-owncloud-update-since-now
      

License

Released under the terms of the GNU GPLv3+.