imm: Execute arbitrary callbacks for each element of RSS/Atom feeds

[ library, program, public-domain, web ] [ Propose Tags ]

Cf README file


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.4.1.0, 0.5.0.0, 0.5.0.1, 0.5.1.0, 0.6.0.0, 0.6.0.1, 0.6.0.2, 0.6.0.3, 1.0.0.0, 1.0.1.0, 1.1.0.0, 1.2.0.0, 1.2.1.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 1.6.0.0, 1.6.1.0, 1.7.0.0, 1.8.0.0, 1.9.0.0, 1.10.0.0, 2.0.0.0, 2.1.0.0, 2.1.1.0
Dependencies aeson, async, atom-conduit (>=0.7), base-noprelude (>=4.7 && <5), binary, blaze-html, blaze-markup, bytestring, case-insensitive, conduit, connection, containers, dhall (<1.27), directory (>=1.2.3.0), fast-logger, filepath, hashable, HaskellNet (>=0.5), HaskellNet-SSL (>=0.3.3.0), http-client (>=0.4.30), http-client-tls, http-types, imm, microlens, mime-mail, monad-time, network (<3), opml-conduit (>=0.7), optparse-applicative, prettyprinter, prettyprinter-ansi-terminal, refined (>=0.4.1), relude, rss-conduit (>=0.4.1), safe-exceptions, stm, stm-chans, streaming-bytestring, streaming-with, text, time, timerep (>=2.0.0.0), tls, typed-process, uri-bytestring, xml-conduit (>=1.5), xml-types [details]
License CC0-1.0
Author kamaradclimber, koral
Maintainer chahine.moreau@gmail.com
Revised Revision 1 made by koral at 2019-10-23T20:42:16Z
Category Web
Home page https://github.com/k0ral/imm
Source repo head: git clone git://github.com/k0ral/imm.git
Uploaded by koral at 2019-06-09T16:17:05Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables imm-sendmail, imm-writefile, imm
Downloads 19099 total (70 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-06-09 [all 1 reports]

Readme for imm-1.6.0.0

[back to package description]

imm

imm is a program that executes arbitrary callbacks (e.g. sending a mail, or writing a file) for each element of RSS/Atom feeds.

imm is written in Haskell, configured in Dhall. The project includes:

  • a main executable imm that users directly run
  • additional executables (imm-writefile and imm-sendmail) that imm can be configured to use as callbacks
  • a Haskell library, that exports functions useful to both the main executable and callbacks; the API is documented in Hackage.

Callbacks

Callbacks are configured through the $XDG_CONFIG_HOME/imm/callbacks.dhall file. A commented template file is bundled with the project.

imm will call each callback once per feed element, and will fill its standard input (stdin) with a JSON object structured as follows:

{
  "feed": "RSS document or Atom feed (XML)",
  "element": "RSS item or Atom entry (XML)"
}

imm expects callbacks to return 0 in case of success, or any other exit code in case of failure, in which case the standard error output (stderr) will be displayed.

Example use cases

Online feed reader

For the sake of I-want-the-mutt-of-feed-readers zealots, it is possible to turn any mail reader into a feed reader, by having imm send an e-mail with unread elements to an arbitrary address. You can then browse your feeds through your favourite mail reader, and leverage any mail-related tool on your feeds. Bonus points if your mail reader is online as you can now access your feeds from any computer connected to the Internet.

Here is an example configuration:

let Callback : Type =
  { _executable : Text
  , _arguments : List Text
  }

let sendMail =
  { _executable = "imm-sendmail"
  , _arguments = ["--login", "-u", "user@domain.com", "-P", "password", "-s", "smtp.domain.com", "-p", "587", "--to", "foo.bar@domain.com"]
  }

let config : List Callback = [ sendMail ]
in config

Offline read-it-later

imm is able to store a local copy of unread elements, to read them later while offline for example. External links won't work offline though.

let Callback : Type =
  { _executable : Text
  , _arguments : List Text
  }

let writeFile =
  { _executable = "imm-writefile"
  , _arguments = [ "-d", "/path/to/folder" ]
  }

let config : List Callback = [ writeFile ]
in config

Example usage

  • Subscribe to a feed:

    imm subscribe http://your.feed.org
    
  • Import feeds from an OPML file:

    cat feeds.opml | imm import
    
  • List subscribed feeds:

    imm list
    
  • Show details about a feed:

    imm show http://your.feed.org
    
  • Unsubscribe from a feed:

    imm unsubscribe http://your.feed.org
    
  • Check for new elements without executing any action:

    imm run --no-callbacks --read-only
    
  • Execute configured callbacks for each new element from subscribed feeds:

    imm run