I don't know if this is even possible, let alone how to do it, but what I'd like to develop is a perl script that would accept as input a 10 digit USA/Canada telephone number and match it to a record in Google Contacts, then return the name associated with that record.

One problem is that Google does not attempt to normalize numbers in their contacts database, therefore in a given contact the phone number might include spaces, hyphens, parenthesis, etc. Basically all non-numeric characters would need to be stripped before the comparison is made. The only exception is where ::: appears, that seems to separate two similar items of the same type in the same field, such as two different phone numbers of the same type. And in any one record there are several fields that can potentially contain phone numbers. Anyway what I really want to to is type in scriptname.pl 9999999999 (with the 9999999999 replaced by the actual ten digit number) and have it find the record containing that number in my Google Contacts, and print the associated name, and I have no idea where to start. Any help would be appreciated!

In reply to How can I get a single record from Google Contacts based on a phone number? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.