Hacking Gmail

(Grace) #1

80 Part II — Getting Inside Gmail


“Jan 6”, -> The date displayed
“<span id=\’[email protected]\’>Ben
Hammersley</span>”, -> Who sent it
“<b>»</b> ”, -> The little icon in the inbox
“Here\’s a nice message.”, -> The subject line
,[] -> Labels
,”” -> Attachments
,”101480d8ef5dc74a” -> The message ID
,0 -> Unknown
,”Thu Jan 6 2005_4:44AM” -> The full date and time

]

You now know how to decode the Gmail mail listing. You can also see how to
request this data structure — by calling the URL, and parsing the returned
JavaScript function. You can do this in simple regular expressions, a topic explored
in Chapter 7.

Storage Space
The detail of the mail in the Inbox isn’t the only information sent when you
request that URL. Look above the mailfunction and you can see the following:
D([“qu”,”1 MB”,”1000 MB”,”0%”,”#006633”]

This line of data sent from Gmail’s servers clearly corresponds to the display at
the bottom of the screen giving your mailbox usage statistics:

D([“qu”,:The name of the Gmail function that deals with the usage
information.

“1 MB”,:The amount of storage used.

“1000 MB”,:The maximum amount available.

“0%”,:The percentage used.

“#006633”:The hex value for a nice shade of green.

Removing Labels


In Figure 5-10 I have added some labels to the Gmail system. Spotting them in
the Tcpflow is easy:
D([“ct”,[[“Heads”,0],[“Knees”,0],[“Shoulders”,0],[“Toes”,0]]]);

You can deduce straight away that the function starting with D([“ct”contains
the names and an unknown value (perhaps it’s a Boolean, perhaps it’s a string, you
don’t know as yet) of the Labels. You can more easily harvest this data when you
come to write your own API.
Free download pdf