Hacking Gmail

(Grace) #1

190 Part III — Conquering Gmail


Listing 13-3 (continued)

$stream->get_tag(“td”);
my $sender = $stream->get_trimmed_text(“/td”);

$stream->get_tag(“td”);
$stream->get_tag(“font”);
$stream->get_tag(“font”);
my $label = $stream->get_trimmed_text(“/font”) || “No
Label”;

$stream->get_tag(“/font”);
my $subject = $stream->get_trimmed_text(“/td”);

$stream->get_tag(“td”);
my $dateline = $stream->get_trimmed_text();
$dateline =~ s/†/ /;

print
“THREADID $threadid\nSTARRED $starred \nSENDER $sender\nLABEL
$label \nSUBJECT $subject\nDATE: $dateline \n\n\n”;

}

Running this code on the saved page in Listing A-4 produces the output in
Listing 13-4.

Listing 13-4: The Result of 13-3 on A-4

THREADID 1025a4065d9b40bf
STARRED Not Starred
SENDER Ben Hammersley
LABEL No Label
SUBJECT hello me
DATE: Feb 28

THREADID 10237338e99e7a8c
STARRED Not Starred
SENDER Ben Hammersley
LABEL No Label
SUBJECT This is the subject line
DATE: Feb 21
Free download pdf