Skip to content


rss2mail

Previously I have wrote lj2mail – a script which gets fresh posts from LiveJournal and emails them to the list of recepients. I have tried to avoid sending same items over and over again, but failed. The script was implemented with the help of LiveJournal API (LJ::Simple Perl module).

I got annoyed by that script repeating some items (mess with publishing date), so I wrote a different one. rss2mail simply gets the RSS feed, parses it and emails items as individual messages to the list of recepients. I guess that caching RSS item link is much better than LiveJournal’s publishing date. Also, rss2mail is much more flexible. It can be used with any RSS feed, not only LiveJournal’s. I have tried to make it as generic as possible. If it doesn’t work with other feeds, just check the fields of the RSS feed it uses.

rss2mail.pl

Posted in All, Programming, Technology.

Tagged with , , .

See also: lj2mail, Linkblogging with del.icio.us, webby_m3u, userspace.pl, undup.


9 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Randy Charles Morin says

    Try R|mail it doesn’t require any knowledge of perl. By just adding a javascript to your blog page, the entire thing just works.

  2. Leonid Mamchenkov says

    And the URL is… :)

  3. Seraphim says

    Is it possible to have this script utilize sendmail instead of smtp?
    How would one go about doing that? Im n00b :D

  4. Leonid Mamchenkov says

    Seraphim,

    Yes, it is possible to use Sendmail instead of SMTP. Just change the line:

    my $mailer = Mail::Mailer->new('smtp',Server=>$smtp_server);

    to

    my $mailer = Mail::Mailer->new('sendmail');

    and it should work. Refer to the documentation of Mail::Mailer Perl module if you have a problem.

  5. Seraphim says

    This is a great script, On my server I set it up as a cron job and the script will continue to send email even though the urls are in the .sent file. in the end of recieving 6000 email I looked at the .sent file and saw hundrend of duplicate entries. what am I doing wrong?

  6. Leonid Mamchenkov says

    Seraphim,

    this sounds really strange. Are you sure about the dups – maybe there is some difference – upper/lower case, slashes at the end of URLs or something like this?

  7. Jamie says

    Hello, just thought you might like to know I took your rss2mail script and converted it to an rss2ascii script.

    It reformats the HTML into a sort of plain-text report and sends it’s output to stdout, where it can be fed into the standard input of other programs (like inews or sendmail) I’m using it to read plain-text versions of RSS on a local news system.


    RSS plaintext converter

  8. Leonid Mamchenkov says

    Thanks for the info, Jamie. It’s nice to know that the script was useful to someone else besides me. :)

Continuing the Discussion

  1. XaraNet Blog » Blog Archive » RSS2Mail - die 2te linked to this post on July 14, 2006

    [...] Misst, hat doch nicht so auf Anhieb geklappt. Ich habs mit dem Perl-Script von Leonid Mamchenkov versucht. Komischerweise sendet er aber teilweise Beiträge doppelt, obwohl ich dienatürlich schon kenne. Hab den Fehler auf Anhieb nicht gefunden und such daher irgendwas neues. Wenn jemand ein Script kennt, freu ich mich natürlich. Am liebsten in PHP oder alternativ Perl. Ich hab einiges in Python gefunden – mag ich aber nicht so gerne und werde ich als letztes ausprobieren [...]



Some HTML is OK

or, reply to this post via trackback.



Rss Feed Tweeter button Facebook button Reddit button Linkedin button Delicious button Digg button Flickr button Stumbleupon button Youtube button