-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f92633
commit c98d842
Showing
5 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
include '../src/gwtdata.php'; | ||
try { | ||
$email = "[email protected]"; | ||
$passwd = "******"; | ||
|
||
# Dates must be in valid ISO 8601 format. | ||
$daterange = array("2012-01-10", "2012-01-12"); | ||
|
||
$gdata = new GWTdata(); | ||
if($gdata->LogIn($email, $passwd) === true) | ||
{ | ||
$sites = $gdata->GetSites(); | ||
foreach($sites as $site) | ||
{ | ||
$gdata->SetDaterange($daterange); | ||
$gdata->DownloadCSV($site); | ||
} | ||
} | ||
} catch (Exception $e) { | ||
die($e->getMessage()); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
include '../src/gwtdata.php'; | ||
try { | ||
$email = "[email protected]"; | ||
$passwd = "******"; | ||
|
||
$gdata = new GWTdata(); | ||
if($gdata->LogIn($email, $passwd) === true) | ||
{ | ||
$sites = $gdata->GetSites(); | ||
foreach($sites as $site) | ||
{ | ||
$gdata->DownloadCSV($site, "./csv"); | ||
} | ||
|
||
$files = $gdata->GetDownloadedFiles(); | ||
foreach($files as $file) | ||
{ | ||
print "Saved $file<br>"; | ||
} | ||
} | ||
} catch (Exception $e) { | ||
die($e->getMessage()); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
include '../src/gwtdata.php'; | ||
try { | ||
$email = "[email protected]"; | ||
$passwd = "******"; | ||
|
||
# Language must be set as valid ISO 639-1 language code. | ||
$language = "de"; | ||
|
||
# Dates must be in valid ISO 8601 format. | ||
$daterange = array("2012-01-01", "2012-01-02"); | ||
|
||
# Valid values are "TOP_PAGES", "TOP_QUERIES", "CRAWL_ERRORS", | ||
# "CONTENT_ERRORS", "CONTENT_KEYWORDS", "INTERNAL_LINKS", | ||
# "EXTERNAL_LINKS" and "SOCIAL_ACTIVITY". | ||
$tables = array("TOP_QUERIES"); | ||
|
||
$gdata = new GWTdata(); | ||
if($gdata->LogIn($email, $passwd) === true) | ||
{ | ||
$gdata->SetLanguage($language); | ||
$gdata->SetDaterange($daterange); | ||
$gdata->SetTables($tables); | ||
|
||
$sites = $gdata->GetSites(); | ||
foreach($sites as $site) | ||
{ | ||
$gdata->DownloadCSV($site); | ||
} | ||
} | ||
} catch (Exception $e) { | ||
die($e->getMessage()); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
include '../src/gwtdata.php'; | ||
try { | ||
$email = "[email protected]"; | ||
$passwd = "******"; | ||
|
||
# If hardcoded, don't forget trailing slash! | ||
$website = "http://www.domain.com/"; | ||
|
||
$gdata = new GWTdata(); | ||
if($gdata->LogIn($email, $passwd) === true) | ||
{ | ||
$gdata->DownloadCSV($website); | ||
} | ||
} catch (Exception $e) { | ||
die($e->getMessage()); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
include '../src/gwtdata.php'; | ||
try { | ||
$email = "[email protected]"; | ||
$passwd = "******"; | ||
|
||
# If hardcoded, don't forget trailing slash! | ||
$website = "http://www.domain.com/"; | ||
|
||
# Valid values are "TOP_PAGES", "TOP_QUERIES", "CRAWL_ERRORS", | ||
# "CONTENT_ERRORS", "CONTENT_KEYWORDS", "INTERNAL_LINKS", | ||
# "EXTERNAL_LINKS" and "SOCIAL_ACTIVITY". | ||
$tables = array("TOP_QUERIES"); | ||
|
||
$gdata = new GWTdata(); | ||
if($gdata->LogIn($email, $passwd) === true) | ||
{ | ||
$gdata->SetTables($tables); | ||
$gdata->DownloadCSV($website); | ||
} | ||
} catch (Exception $e) { | ||
die($e->getMessage()); | ||
} | ||
?> |