diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:47:55 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:47:55 -0300 |
commit | b4e2708c6f8cc2191c581aef404803478e65e678 (patch) | |
tree | 703d3f7f8f96d9564e7cc3f8ebf85a38c93ab3e1 /misc/parse-remind | |
parent | 4fdd3ebb2b0622fb6cff7376a02a5b92c1aba2ae (diff) | |
download | scripts-b4e2708c6f8cc2191c581aef404803478e65e678.tar.gz scripts-b4e2708c6f8cc2191c581aef404803478e65e678.tar.bz2 |
Moved scripts to custom repos
Diffstat (limited to 'misc/parse-remind')
-rwxr-xr-x | misc/parse-remind | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/misc/parse-remind b/misc/parse-remind deleted file mode 100755 index bdd9f23..0000000 --- a/misc/parse-remind +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl -# -# This script is designed to have an email piped to it eg. from mutt. -# It will split apart all the text/calendar attachments and enter them into -# the 'remind' calendar. -# - -use strict; -use warnings; - -use MIME::Parser; - -my $CONVERT = '~/.mutt/ical2rem.pl'; -my $REMINDERS = '~/remind/mutt.rem'; - -################################################################################ - -my $parser = new MIME::Parser; -$parser->output_under('/tmp'); -my $entity = $parser->parse(\*STDIN); - -my @parts = $entity->parts(); -my $count = 0; - -foreach my $part (@parts) { - if ($part->head->mime_type eq 'text/calendar') { - my $body = $part->bodyhandle; - my $cmd = $CONVERT.' '.$body->path.' >> '.$REMINDERS; - print STDERR `$cmd`; - last if ($? != 0); - $count++; - } -} - -$parser->filer->purge; -if ($count == 0) { - print STDERR "No calendar entries found."; - exit(1); -} - -exit(0); |