Вы находитесь на странице: 1из 6

Elfeed Emacs Web Feed Reader

Elfeed is an extensible web feed reader for Emacs, supporting both Atom and RSS. It requires Emacs 24 and is available for download from MELPA. Elfeed was inspired by notmuch. For a longer overview, Introducing Elfeed, an Emacs Web Feed Reader. Tips and Tricks . . . and more . . .

The database format is now stable, but there may still be an update someday that requires you to initialize a new database from scratch.

Getting Started
Elfeed is broken into a multiple source les, so if you manually install it you will need to add the Elfeed package directory to your load-path. If installed via ELPA, this will be done automatically. It is recommended that you make a global binding for elfeed. (global-set-key (kbd "C-x w") elfeed)

Running the interactive function elfeed will pop up the *elfeed-search* buer, which will display feed items. g: refresh view of the feed listing G: fetch feed updates from the servers s: update the search lter (see tags) This buer will be empty until you add your feeds to the elfeed-feeds list and initiate an update with M-x elfeed-update (or G in the Elfeed buer). This will populate the Elfeed database with entries. ;; Somewhere in your .emacs file (setq elfeed-feeds ("http://nullprogram.com/feed/" "http://www.terminally-incoherent.com/blog/feed/")) Another option for providing a feel list is with an OPML le. Running M-x elfeed-load-opml will ll elfeed-feeds with feeds listed in an OPML le. When elfeed-load-opml is called interactively, it will automatically save the feedlist to your customization le, so you will only need to do this once. If there are a lot of feeds, the initial update will take noticeably longer than normal operation because of the large amount of information being written the database. Future updates will only need to write new or changed data. If updating feeds slows down Emacs too much on your computer, reduce the value of elfeed-max-connections (the number of feeds to process at one time). From the search buer there are a number of ways to interact with entries. Entries are selected by placing the point over an entry. Multiple entries are selected at once by using an active region. RET: view selected entry in a buer b: open selected entries in your browser (browse-url) y: copy selected entries URL to the clipboard r: mark selected entries as read u: mark selected entries as unread +: add a specic tag to selected entries -: remove a specic tag from selected entries

Tags
Elfeed maintains a list of arbitrary tags symbols attached to an entry. The tag unread is treated specially by default, with unread entries appearing in bold.

Autotagging Tags can automatically be applied to entries discovered in specic feeds through extra syntax in elfeed-feeds. Normally this is a list of strings, but an item can also be a list, providing set of autotags for a feeds entries. (setq elfeed-feeds (("http://nullprogram.com/feed/" blog emacs) "http://www.50ply.com/atom.xml" ; no autotagging ("http://nedroid.com/feed/" webcomic))) Filter Syntax To make tags useful, the Elfeed entry listing buer can be ltered by tags. Use elfeed-search-set-filter (or s) to update the lter. Any component of the search string beginning with a + or a - is treated like a tag. + means the tag is required, - means the tag must not be present. A component beginning with a @ indicates an age. Entries older than this age are ltered out. The age description accepts plain English, but cannot have spaces, so use dashes. For example, "@2-years-old" or "@3-days-ago". The database is date-oriented, so lters that include an age restriction are signicantly more ecient. All other components are treated as a regular expression. Here are some example lters. @6-months-ago +unread Only show unread entries of the last six months. This is the default lter. linu[xs] @1-year-old Only show entries about Linux or Linus from the last year. -unread +youtube Only show previously-read entries tagged as youtube.

Tag Hooks The last example assumes youve tagged posts with youtube. You probably want to do this sort of thing automatically, which can be done with the elfeed-new-entry-hook. Functions in this hook are called with new entries, allowing them to be manipulated, such as adding tags. ;; Mark all YouTube entries (add-hook elfeed-new-entry-hook (elfeed-make-tagger :feed-url "youtube\\.com" :add (video youtube))) Avoiding tagging old entries as unread: ;; Entries older than 2 weeks are marked as read (add-hook elfeed-new-entry-hook (elfeed-make-tagger :before "2 weeks ago" :remove unread)) Or building your own subset feeds: (add-hook elfeed-new-entry-hook (elfeed-make-tagger :feed-url "example\\.com" :entry-title (not "something interesting") :add junk :remove unread))

Web Interface
Elfeed includes a web interface for remote network access. Its a single-page web application that follows the database live as new entries arrive. Its packaged separately on MELPA as elfeed-web. To re it up, run M-x elfeed-web-start and visit http://localhost:8080/elfeed/ (check your httpd-port) with a browser. See the elfeed-web.el header for endpoint documentation if youd like to access the Elfeed database through the web API. Its a bit rough at the moment no keyboard shortcuts, read-only, no authentication, and a narrow entry viewer but Im looking to improve it in the future. This will be Elfeeds mobile interface.

Platform Support
I only use Elfeed on Linux right now, but Ive also tested it on Windows. Unfortunately the Windows port of Emacs is a bit too unstable for parallel feed 5

downloads, not to mention the tiny, hard-coded, 512 open descriptor limitation, so it limits itself to one feed at a time on this platform. However, even on Linux Elfeed occasionally triggers segmentation faults in Emacs. If I am able, I intend to isolate these segfaults and report them to the Emacs developers. The GNU-provided W32 build of Emacs doesnt include any of the libraries needed to actually view entries within Emacs, but you can still see the entry listing and visit entries in your browser. So on Windows youll either have to track down and install the missing DLLs, or use ntemacs, which includes these libraries.

Database Management
The database should keep itself under control without any manual intervention, but steps can be taken to minimize the database size if desired. The simplest option is to run the elfeed-db-compact command, which will pack the loose-le content database into a single compressed le. This function can be added to kill-emacs-hook. Going further, a function could be added to elfeed-new-entry-hook to strip unwanted/unneeded content from select entries before being stored in the database. For example, for YouTube videos only the entry link is of interest and the regularly-changing entry content could be tossed to save time and storage.

Status and Roadmap


Elfeed is to the point where it can serve 100% of my own web feed needs. My personal selection of about 140 feeds has been acting as my test case as I optimize and add features. Some things I still might want to add: Database synchronization between computers Support for RDF content

Motivation
As far as I know, outside of Elfeed there does not exist an extensible, text-le congured, power-user web feed client that can handle a reasonable number of feeds. The existing clients Ive tried are missing some important capability that limits its usefulness to me.

Вам также может понравиться