Donate Share

libgmailer for PHP

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Fetching Contacts

You are viewing a single message from this topic. View all messages.

  1. 2008-10-27 02:30:53 UTC
    I'm using the cvs version to try to get my contacts

    Here's the script

    <?php
    require("libgmailer.php");
    $gm = new GMailer();
    $D_FILE="debug.log";
    $D_ON=true;
    $gmail_acc = "acc";
    $gmail_pwd = "pwd";
    $my_timezone = -6;

    $gm->setLoginInfo($gmail_acc, $gmail_pwd, $my_timezone);
    if ($gm->connect()) {
    echo "status ".$gm->lastActionStatus()."<br>\n";
    $gm->fetchBox(GM_CONTACT, "all", 0);
    echo "status ".$gm->lastActionStatus()."<br>\n";
    $snapshot = $gm->getSnapshot(GM_CONTACT);
    var_dump($snapshot);
    echo "status ".$gm->lastActionStatus()."<br>\n";
    if (!empty($snapshot->contacts)) {
    echo "Your frequently used addresses:<br>\n";
    foreach ($snapshot->contacts as $item) {
    echo "Name: " . $item["name"] . " Email: " . $item["email"] . "\n";
    }
    }
    } else {
    echo "unable to connect ".$gmailer->lastActionStatus()."\n";
    }

    var_dump($_SESSION);
    ?>

    The log says
    <?php /** FAILED to read id_key from server. **/ ?>

    and the var_dump of the snapshot says
    object(GMailSnapshot)[2]
    public 'created' => int 0
    public 'snapshot_error' => string 'Invalid response from Gmail (empty)' (length=35)

    I tried a couple patches
    http://easywww.wordpress.com/2008/10/01/php-libgmailer-patch/
    http://dev.notoptimal.net/2007/11/new-gmail.html



< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.