[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Incorporating RSS and Atom feeds
From: |
Leonardo Taccari |
Subject: |
Re: [Nmh-workers] Incorporating RSS and Atom feeds |
Date: |
Fri, 19 May 2017 14:25:25 +0200 |
Hello Thomas!
Thomas Levine writes:
> I have incorporated RSS and Atom feeds as MH messages so that I may read the
> feeds with nmh.
> https://pypi.python.org/pypi/fh
> https://thomaslevine.com/scm/fh/artifact/4f0dd5f8873a8d17
>
> Has someone else already written a better version of this? My implementation
> so far has only some of the features that I want.
I'm pretty happy with rss2email. Apart some (pkgsrc) LOCALPATCHES[0]
all the works is done by an AWK script (and `rsssm' calls it in order to
ignore all possible - and irrelevant - sendmail flags passed by
rss2email):
% cat rsssm
#!/bin/sh
rsssm-plumber
% cat rsssm-plumber
#!/usr/bin/awk -f
/^To:/ {
if (!folder) {
to = $2
sub(/@.*/, "", to)
folder = to
storer = "MH=~/.mh_rss_profile /usr/pkg/libexec/nmh/rcvstore +"
folder
}
}
{
if (!storer) {
lines = (lines) ? lines "\n" $0 : $0
} else {
if (lines) {
print lines "\n" $0 | storer
lines = ""
} else {
print $0 | storer
}
}
}
END {
close(storer)
}
...then I just set in ~/.config/rss2email.cfg
email-protocol = sendmail
sendmail = /home/leot/bin/rsssm
...and adjust every feed entry as follows:
[feed.example]
url = http://www.example.org/feed.rss
to = address@hidden
In that way `rsssm-plumber' will just process the `To:' header and
then store the feed^Wmails accordingly in the `+example' folder.
[0]: https://www.NetBSD.org/~leot/pkgsrc-localpatches/mail/rss2email/