-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathexample-3.php
More file actions
28 lines (24 loc) · 759 Bytes
/
example-3.php
File metadata and controls
28 lines (24 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?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());
}