nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Incorporating RSS and Atom feeds

2017-05-19 07:26:15
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 = example@rss2email.invalid

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/

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>