|
NAMEWWW::GMail - Perl extension for accessing Google Mail (gmail)SYNOPSISuse WWW::GMail; my $obj = WWW::GMail->new( username => "USERNAME", password => "PASSWORD", cookies => { autosave => 1, file => "./gmail.cookie", }, ); my $ret = $obj->login(); if ($ret == -1) { print "password incorrect\n"; } elsif ($ret == 0) { print "unable to login $obj->{error}\n"; exit; } my @list = $obj->get_message_list('inbox'); # count the new messages in the inbox my $new_msgs = 0; for my $i ( 0 .. $#list ) { $new_msgs += $list[$i]->[1]; # count the unread flags } print "you have $new_msgs new messages in your inbox\n"; my @contacts = $obj->get_contact_list(); print "you have ".(@contacts)." contacts\n"; my $gmail = 0; for my $i ( 0 .. $#contacts ) { $gmail += ($contacts[$i]->[3] =~ m/gmail\.com$/i); } print "$gmail of them are gmail addresses\n"; $obj->logout(); ABSTRACTThis module simplifies access to gmail.DESCRIPTIONCurrently this module allows retrieval of message lists, raw messages, and the contact list. All requests to gmail are secured using ssl.MethodsThere are currently 5 methods
0 message id (pass this to get_message_raw) 1 unread = 1,read = 0 2 starred = 1,not = 0 3 date 4 from 5 indicator 6 subj 7 sent 8 labels 9 attachments 10 message id (again?) 11 ? unknown 12 full date See the SYNOPSIS Also available after calling get_message_list is: Used space $self->{used} Total space $self->{total} Percent used $self->{percent_used} Per page $self->{per_page} List total $self->{list_total} List folder $self->{list_folder} Labels $self->{labels} (an array of arrays) The array 0 label 1 number of new
0 Contact id 1 Name 2 Name or blank (not sure what this is) 3 Email 4 Notes
EXPORTNothing. Its all Object Orientated.SEE ALSOLWP::UserAgent, HTTP::CookiesTODOContact management, label management, and better docs. Also, what happends when the js_version changes? Enable persistant cookie?AUTHORDavid Davis <xantus@cpan.org>NOTICE**Use this module at your own risk, and read Gmail's terms of use**COPYRIGHT AND LICENSECopyright 2004-2005 by David Davis and Teknikill SoftwareThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |