feeds2imap.clj icon indicating copy to clipboard operation
feeds2imap.clj copied to clipboard

Pull RSS/Atom feeds to your IMAP folders with Clojure on JVM.

feeds2imap.clj

License Dependencies Status Downloads Build Clojars Project Clojars Project clojure feeds reader

RSS/Atom reader implemented in Clojure. It stores new items in the mail folders using IMAP APPEND command (java.mail framework).

Configuration

By default configuration dir is $HOME/.config/feeds2imap.clj. You can change it setting environment variable $FEEDS2IMAP_HOME (something like FEEDS2IMAP_HOME=/home/me/.someotherdir lein ...).

The only file required to run the code is imap.clj. Take a look at imap.clj.example for details.

Feeds and folders can be added using the add command (see below), or you can write them directly in the urls.clj file (inside the configuration directory). The format of this file is as follows:

{:folder1 ["url1" "url2" ...]
 :folder2 [...]
 ...}

Usage

You can use lein plugin.

Or you can use lein run to run programm or you can generate jar with lein uberjar and run programm with java -jar <path-to-jar>.

  • LAUNCH-COMMAND - pull new items.
  • LAUNCH-COMMAND pull - pull new items.
  • LAUNCH-COMMAND auto - pull new items every 1 hour in the loop.
  • LAUNCH-COMMAND show - show feeds list (url.clj file content).
  • LAUNCH-COMMAND add folder-name feed-url - add url to feeds file to the folder folder-name.
  • LAUNCH-COMMAND imap encrypt - encrypt imap.clj file using gpg
  • LAUNCH-COMMAND imap decrypt - decrypt imap.clj file using gpg
  • LAUNCH-COMMAND opml2clj filename.xml [path/to/urls.clj] - convert OPML file to urls.clj format

where LAUNCH-COMMAND = lein run / lein trampoline run / java -jar jarfile.jar.

Sample systemd user service (~/.config/systemd/user)

[Unit]
Description=Clojure feeds reader

[Service]
ExecStart=lein feeds2imap auto

[Install]
WantedBy=default.target
systemctl --user enable feeds2imap.service
systemctl --user start feeds2imap.service

All service output will be collected by journald.

License

Copyright © 2013-2016 Max Gonzih gonzih @ gmail.com

Distributed under the MIT license.

Thanks

Thanks to Greg Hendershott for original idea implemented in Racket http://www.greghendershott.com/2013/05/feeds2gmail.html

Similar projects