Skip to content

Commit 71d99b6

Browse files
committed
Removed method.
1 parent fab0e20 commit 71d99b6

File tree

1 file changed

+13
-30
lines changed

1 file changed

+13
-30
lines changed

src/Gwt/Client.php

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,20 @@ public function getTableData($tableName)
194194
case 'EXTERNAL_LINKS':
195195
case 'SOCIAL_ACTIVITY':
196196
case 'LATEST_BACKLINKS':
197-
$data = $this->downloadCSV_XTRA(
198-
$this->getWebsite(),
199-
$tableName,
200-
$this->getDateStart(),
201-
$this->getDateEnd()
197+
$options = $this->getTableOptions($tableName);
198+
199+
$url = sprintf(
200+
self::SERVICEURI . $options['token_uri'] . '?hl=%s&siteUrl=%s',
201+
$this->getLanguage(), $this->getWebsite()
202+
);
203+
$token = $this->getToken($url, $options['token_delimiter'], $options['dl_uri']);
204+
205+
$url = sprintf(
206+
self::SERVICEURI . $options['dl_uri'] . '?hl=%s&siteUrl=%s&security_token=%s&prop=ALL&db=%s&de=%s&more=true',
207+
$this->getLanguage(), $this->getWebsite(), $token, $this->getDateStart()->format('Ymd'), $this->getDateEnd()->format('Ymd')
202208
);
209+
210+
$data = $this->getData($url);
203211
break;
204212
default: // TOP_QUERIES || TOP_PAGES
205213
$downloadUrls = $this->getDownloadUrls($this->getWebsite());
@@ -534,31 +542,6 @@ protected function getDownloadUrls($site)
534542
return json_decode($downloadList, true);
535543
}
536544

537-
/**
538-
* Downloads "unofficial" downloads based on the given URL.
539-
*
540-
* @param string $site Site URL available in GWT Account.
541-
* @param string $tableName Table name to be downloaded
542-
* @return mixed downloaded data
543-
*/
544-
private function downloadCSV_XTRA($site, $tableName, DateTime $dateStart, DateTime $dateEnd)
545-
{
546-
$options = $this->getTableOptions($tableName);
547-
548-
$uri = sprintf(
549-
self::SERVICEURI . $options['token_uri'] . '?hl=%s&siteUrl=%s',
550-
$this->getLanguage(), $site
551-
);
552-
$token = $this->getToken($uri, $options['token_delimiter'], $options['dl_uri']);
553-
554-
$url = sprintf(
555-
self::SERVICEURI . $options['dl_uri'] . '?hl=%s&siteUrl=%s&security_token=%s&prop=ALL&db=%s&de=%s&more=true',
556-
$this->getLanguage(), $site, $token, $dateStart->format('Ymd'), $dateEnd->format('Ymd')
557-
);
558-
559-
return $this->getData($url);
560-
}
561-
562545
/**
563546
* Regular Expression to find the Security Token for a download file.
564547
*

0 commit comments

Comments
 (0)