[Bio] / IGSBPortal / scripts / get_list4status.pl Repository:
ViewVC logotype

View of /IGSBPortal/scripts/get_list4status.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Jul 6 17:05:45 2010 UTC (9 years, 4 months ago) by wilke
Branch: MAIN
CVS Tags: HEAD
*** empty log message ***

#!/usr/bin/env perl

use strict;
use warnings;

use Getopt::Long;
use Data::Dumper;
use Mail::Mailer;

use IGSBportal::IGSBDB;




  

# read in parameters

my $status            = 'new';       
my $verbose           = 0 ;
my $send_notification = 0;
my $debug             = 0;

GetOptions ( 'status=s'  => \$status ,
	     'verbose'   => \$verbose ,
	     'send_mail' => \$send_notification,
	     'debug'     => \$debug,
           );


print STDERR "Getting IGSBDB object\n" if ($debug);
 my $igsb = IGSBportal::IGSBDB->new();

print STDERR "Getting list for $status\n" if ($debug);
my $list = $igsb->get_requests_by_status($status);

print STDERR Dumper $list , "\n" if ($debug);


my $text4mail = '
';


foreach my $r  (@$list){
  print join "\t" , $r->ID , $r->current_status , $r->ltime  , "\n" if ($verbose);
  $text4mail .= "http://hgac.igsb.org/igsb.cgi?page=ManageOffers&request=".$r->ID." \t " . $r->ID . "\t" . $r->current_status . "\t" . $r->ltime . "\n";
}




# send mail
if ($send_notification and scalar@$list ){
  my $mailer = Mail::Mailer->new();
  $mailer->open({ From    => 'sequencing@igsb.anl.gov',
		  To      => 'wilke@mcs.anl.gov mdomanus@anl.gov mendez@mcs.anl.gov',
		  Subject =>  "New Offer Requests" ,
		}) or die "Can't open Mail::Mailer: $!\n";
  print $mailer $text4mail ;
  $mailer->close() or die "couldn't send whole message: $!\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3