Hacking Gmail

(Grace) #1

178 Part III — Conquering Gmail


Figure 12-1 The Gmail contacts list

Importing Contacts.


You’ve got a list of contacts, and you’re not going home until you’ve added them
to your Gmail account. Hurrah, then, for Listing 12-1. This provides the basis
for a script to allow you to add contacts programmatically. It uses, as ever, the
Utils.pm and Mail::Webmail::Gmail modules that you’ve been working with
since Chapter 7.

Listing 12-1: Adding a Contact

use Utils;

$gmail = login();

# input data from keyboard
print “name:\n”;
$name = <>;
print “email:\n”;
$email = <>;
print “notes:\n”;
$notes = <>;
Free download pdf