El codigo
Código
#!usr/bin/perl #Gmail Inbox 0.1 #Coded By Doddy H #Modules #ppm install http://www.open.com.au/radiator/free-downloads/Net-SSLeay.ppd #http://search.cpan.org/~sullr/IO-Socket-SSL-1.54/SSL.pm #http://search.cpan.org/~fays/GMail-Checker-1.04/Checker.pm use GMail::Checker; use HTML::Strip; head(); while (1) { if ( $op eq "1" ) { listar( $user, $pass ); } elsif ( $op eq "2" ) { getallmsg( $user, $pass, $id ); } elsif ( $op eq "3" ) { copyright(); } else { } } sub listar { my $total = total( $_[0], $_[1] ); for my $num ( 1 .. $total ) { getdata( $_[0], $_[1], $num ); } } sub total { my $mod_total = new GMail::Checker( USERNAME => $_[0], PASSWORD => $_[1] ); my ( $a, $b ) = $mod_total->get_msg_nb_size("TOTAL_MSG"); } sub getdata { my $mod_msg = new GMail::Checker( USERNAME => $_[0], PASSWORD => $_[1] ); my @msg = $mod_msg->get_msg( MSG => $_[2] ); my $mas = $msg[0]->{headers}; if ( $mas =~ /From: (.*)/ig ) { my $from = $1; } if ( $mas =~ /Subject: (.*)/ig ) { my $asunto = $1; } if ( $mas =~ /Date: (.*)/ig ) { my $date = $1; } } sub getallmsg { my $mod_msg = new GMail::Checker( USERNAME => $_[0], PASSWORD => $_[1] ); my @msg = $mod_msg->get_msg( MSG => $_[2] ); my $mas = $msg[0]->{headers}; if ( $mas =~ /From: (.*)/ig ) { my $from = $1; } if ( $mas =~ /To: (.*)/ig ) { my $to = $1; } if ( $mas =~ /Subject: (.*)/ig ) { my $asunto = $1; } if ( $mas =~ /Date: (.*)/ig ) { my $date = $1; } my $text = $msg[0]->{body}; if ( $text =~ /<body class=3D'hmmessage'><div dir=3D'ltr'>(.*?)<\/div><\/body>/sig ) { my $body = $1; $body =~ s/<br>/\n/g; my $uno = HTML::Strip->new( emit_spaces => 1 ); my $body = $uno->parse($body); } } sub head { @@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@ @@ @@@ @ @ @ @ @@ @@@@ @@@ @ @ @ @@@ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @@@@ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@ @ @ @ @ @@@@ @ @ @ @ @ @@@@ @@@ @ @ ); } sub copyright { <stdin>; } #The End ?
Ejemplo de uso
Código:
@@@@ @ @ @ @
@ @ @ @ @
@ @ @ @
@ @@@ @@ @@@ @ @ @ @ @@ @@@@ @@@ @ @
@ @@@ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @
@ @ @ @ @ @@@@ @ @ @ @ @ @ @ @ @ @@
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@
@ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@@@ @ @ @ @ @@@@ @ @ @ @ @ @@@@ @@@ @ @
[+] Username : lagartojuancho
[+] Password : juancho123
[+] Options
[1] : Messages list
[2] : Read Message
[3] : Exit
[+] Option : 1
[+] Messages found : 8
[+] ID : 1
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : RE: Server just blew up
[+] Date : Mon, 23 Apr 2012 18:55:33 -0300
[+] ID : 2
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : RE: Server just blew up
[+] Date : Mon, 23 Apr 2012 18:56:59 -0300
[+] ID : 3
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : RE: Server just blew up
[+] Date : Mon, 23 Apr 2012 19:07:20 -0300
[+] ID : 4
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : hola tonton
[+] Date : Mon, 23 Apr 2012 19:26:17 -0300
[+] ID : 5
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : hola tonton
[+] Date : Mon, 23 Apr 2012 19:26:21 -0300
[+] ID : 6
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : ASUNTO
[+] Date : Mon, 23 Apr 2012 19:30:10 -0300
[+] ID : 7
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : ASUNTO FINAL
[+] Date : Tue, 24 Apr 2012 12:39:14 -0300
[+] ID : 8
[+] From : Van Helsing <lepuke@hotmail.com>
[+] Subject : hola
[+] Date : Wed, 25 Apr 2012 14:13:22 -0300
[+] Options
[1] : Messages list
[2] : Read Message
[3] : Exit
[+] Option :