GitXplorerGitXplorer
e

GWT_CrawlErrors-php

public
38 stars
31 forks
3 issues

Commits

List of commits on branch master.
Unverified
6eb64c8875e2058b525e7ae5cf9277956da014ec

Fix #8 - Don't interpret leading '@' in POST value

eeyecatchup committed 11 years ago
Unverified
dcb8f57da66d8e1042476392f5187a817d592e3a

Merge pull request #7 from arpitHub/fix-get-array-method

eeyecatchup committed 11 years ago
Unverified
b3820f7792cbd39d4d313280f773532922989b72

fixed getArray method for crawl errors

committed 11 years ago
Unverified
f98796db74d8727dd3abe09c55562948e70b6d59

Merge pull request #3 from Osukaru/master

eeyecatchup committed 11 years ago
Unverified
f629495ca449be7724664cabee596b0b30bfad19

Fixed error when crawling errors from more than one site.

OOsukaru committed 11 years ago
Unverified
2b9da1dea1a65303ecfff0476b4b49f4df4e5f0f

Fixed wrong links in README

eeyecatchup committed 11 years ago

README

The README file for this repository.

GwtCrawlErrors: Download website crawl errors from Google Webmaster Tools as CSV.

Introduction

This project provides an easy way to automate downloading of crawl errors from Google Webmaster Tools.

Usage

This document explains how to automate the file download process from Google Webmaster Tools by showing examples for using the php class GwtCrawlErrors.

Get started

To get started, the steps are as follows:

Note

This class will download all crawl errors that are currently listed for a domain in Webmaster Tools. Depending on your domain, this can be a lot of data. The csv file size for 25k crawl errors, for example, is somewhere between 5 and 8 Mb. So, please consider that processes may take some time!

Example 1 - Download via browser

To download CSV data for a single domain name via a web browser, the steps are as follows:

  • In the same folder where you added the GwtCrawlErrors.class.php, create and run the following PHP script.
    You'll need to replace the example values for "mail" and "pass" with valid login details for your Google Account and for "domain" with a valid URL for a site registered in your GWT account.
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'GwtCrawlErrors.class.php';

/**
 * Example 1:
 * Download a CSV for a specific domain from the browser.
 */
try {
    $mail = 'eyecatchup@gmail.com';
    $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());
}

This will force a download in your browser (using HTTP headers) to download one CSV file named gwt-crawlerrors-www.domain.com-YYYYmmdd-H:i:s.csv.

Example 2 - Download to filesystem

To download CSV data for a single domain name directly to the local file system (eg. when executing from command line), the steps are as follows:

  • In the same folder where you added the GwtCrawlErrors.class.php, create and run the following PHP script.
    You'll need to replace the example values for "mail" and "pass" with valid login details for your Google Account and for "domain" with a valid URL for a site registered in your GWT account.
<?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 = 'eyecatchup@gmail.com';
    $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());
}

This will create one CSV file named gwt-crawlerrors-www.domain.com-YYYYmmdd-His.csv in the specified path.

Example 3 - Bulk downloads

To download CSV data for each domain connected to the Google WMT account to the local file system (eg. when executing from command line), the steps are as follows:

  • In the same folder where you added the GwtCrawlErrors.class.php, create and run the following PHP script.
    You'll need to replace the example values for "mail" and "pass" with valid login details for your Google Account.
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'GwtCrawlErrors.class.php';

/**
 * Example 3:
 * Save a CSV for each domain connected to the GWT account
 * to a specific local path.
 */
try {
    $mail = 'eyecatchup@gmail.com';
    $pass = '********';

    $gwtCrawlErrors = new GwtCrawlErrors();

    if ($gwtCrawlErrors->login($mail, $pass)) {
        // iterate over all connected domains
        $sites = $gwtCrawlErrors->getSites();
        foreach($sites as $domain) {
            // use an absolute path without trailing slash as
            // a second parameter, to write data to file system.
            $gwtCrawlErrors->getCsv($domain, __DIR__);
        }

    }
}
catch (Exception $e) {
    die($e->getMessage());
}

This will create a CSV file named gwt-crawlerrors-www.domain.com-YYYYmmdd-His.csv, for each domain connected to the Google WMT account, in the specified path.

License

(c) 2013 - now, Stephan Schmitz eyecatchup@gmail.com
License: MIT, http://eyecatchup.mit-license.org
URL: https://github.com/eyecatchup/GWT_CrawlErrors-php