#!/usr/bin/perl # Written by Jeff Borders # 04/15/06 -- Version 1.2 -- Fixed output. # 12/18/05 -- Version 1.1 -- Chopped off more text in the beginning # of message to save chars for more book titles. # 12/09/05 -- Version 1.0 # # This program accepts an email # filtered by procmail # from the columbus library and # strips all non-essential information. # The output only contains a short # email with reserved or due items, # location and hold time. # # The result is sent via Mail::Mailer # to my motorola phone which has # about a 425 character limit. use strict; use warnings; use Mail::Mailer; $|=1; my $key="at the New Albany Branch Library:"; my $true=0; my $subject=""; my $body=""; my $mailer = Mail::Mailer->new(); my $from_address="DISCOVERY_PLACE_LIBRARIES\@DP1.CML.LIB.OH.US"; my $from_address="CML"; my $to_address="yournumberhere\@page.nextel.com"; while (<>) { if ($_ =~ m/^$key/) { $true=1; } elsif ($_ =~ m/^\*\*\*\* Your timely pick up/) { $true=0; $subject="Reserved Items"; } elsif ($_ =~ m/Please return or renew/) { $true=0; $subject="Due Items"; } if ($true==1) { $body=$body.$_; } } # send email to phone $mailer->open({ From => $from_address, To => $to_address, Subject => $subject, }) or die "Can’t open: $!\n"; print $mailer $body; $mailer->close(); #