1
0
Fork 0
Export the Elfeed database to more generic data formats.
Find a file
2024-08-06 06:12:12 +02:00
.gitignore Add .gitignore 2024-08-03 09:35:11 +02:00
elfeed-export.el Add CSV export 2024-08-06 06:12:12 +02:00
elfeed-export.info Add CSV export 2024-08-06 06:12:12 +02:00
LICENSE.txt Initial commit of Emacs package to export the Elfeed database to JSON 2024-08-01 21:55:06 +02:00
README.org Add CSV export 2024-08-06 06:12:12 +02:00

elfeed-export

Introduction

elfeed-export exports your feed entries from the elfeed RSS reader for Emacs.

The following export formats are currently supported:

Format Command
CSV elfeed-export-to-csv-file
Emacs Lisp Data (*.eld) elfeed-export-to-lisp-file
JSON elfeed-export-to-json-file

Please note there is no import functionality. The goal is to have a (more or less) readable copy of your database. For a real backup, make a backup of ~/.elfeed instead.

Installation

elfeed-export is not on MELPA, therefore clone the directory first:

git clone https://codeberg.org/bram85/elfeed-export.git

Then configure the package as follows:

  (use-package elfeed-export
    :ensure nil
    :load-path "/path/to/elfeed-export")

Configuration

The following table shows the customizable settings for elfeed-export:

Custom variable Description
elfeed-export-exclude-tags Do not export entries that have any of these tags.
elfeed-export-fields Which fields to export per entry and a function to obtain the value.
elfeed-export-include-tags Export entries that have any of these tags.
elfeed-export-predicates Entries that match all of these predicates are exported.

Customize export fields

Which fields are exported can be configured with the elfeed-export-fields variable. You may want to remove certain fields from the default, or add new fields. The variable is an alist, each element has a symbol in the car for the column name, and a function in the cdr to retrieve a value.

Some elfeed extensions supplement the elfeed index with their data, such as elfeed-score. To add a field to the export which shows the score per entry, add the following in your configuration file:

  (add-to-list 'elfeed-export-fields
               '(score . elfeed-score-scoring-get-score-from-entry)
               t)

Likewise, if you use elfeed-curate, you can export annotations as follows:

  (add-to-list 'elfeed-export-fields
               '(annotation . elfeed-curate-get-entry-annotation)
               t)

Customize entry filters

The variable elfeed-export-predicates is a list of predicates applied to each entry. An entry that matches all predicates makes it into the export. Each predicate takes one argument: the entry object.

By tag

By default, there is a tag-based predicate, which is configured by the variables elfeed-export-include-tags and elfeed-export-exclude-tags. They're a list of symbols that represent a tag. E.g., to export unread items only, use:

  (add-to-list 'elfeed-export-include-tags 'unread)

By default, items tagged as noexport are omitted.

By feed

To export entries for a certain RSS feed only, use the following configuration snippet:

  (add-to-list 'elfeed-export-predicates
               (lambda (entry)
                 (let* ((feed (elfeed-entry-feed entry))
                        (title (elfeed-feed-title feed))
                        (_url (elfeed-feed-url feed)))
                   (string-match-p (rx "LWN.net") title))))