예제 #1
0
<?php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'GwtCrawlErrors.class.php';
/**
 * Example 2:
 * Save a CSV for a specific domain to a specific local path.
 */
try {
    $mail = '*****@*****.**';
    $pass = '******';
    $domain = 'http://www.domain.tld/';
    // must have trailing slash!
    $gwtCrawlErrors = new GwtCrawlErrors();
    if ($gwtCrawlErrors->login($mail, $pass)) {
        // save the crawl errors to a local path
        $gwtCrawlErrors->getCsv($domain, __DIR__);
    }
} catch (Exception $e) {
    die($e->getMessage());
}
예제 #2
0
<?php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'GwtCrawlErrors.class.php';
/**
 * Example 1:
 * Download a CSV for a specific domain from the browser.
 */
try {
    $mail = '*****@*****.**';
    $pass = '******';
    $domain = 'http://www.domain.tld/';
    // must have trailing slash!
    $gwtCrawlErrors = new GwtCrawlErrors();
    if ($gwtCrawlErrors->login($mail, $pass)) {
        // force download in browser (using http headers)
        $gwtCrawlErrors->getCsv($domain);
    }
} catch (Exception $e) {
    die($e->getMessage());
}