Jeff-Lewis / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

how to download urls that are relevant to a keyword #657

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
relevant to the java library
com.google.gdata.client.webmastertools.WebmasterToolsService

so far we can only download through the following request types

"TOP_PAGES":"/webmasters/tools/top-search-urls-dl
"TOP_QUERIES":"/webmasters/tools/top-search-queries-dl

but what if i want to download the urls that are relevant to a specific keyword 
via this service
webmasters/tools/query-details-dl?hl=en&siteUrl=MYSITEURL%2F&security_token=***&
prop=ALL&region&db=STARTDATE&de=ENDDATE&more=true&query=SOMEKEYWORD&type=URLS&fo
rmat=csv

so i can tell which keywords led to which pages in my site

the same is available through the web master html pages , if i click on a 
certain keyword it will display all URLS that this specific keyword led to it.

Original issue reported on code.google.com by aos...@gmail.com on 21 Apr 2013 at 5:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello,

I have he same problem, i had added a function to gwtdata

public function DownloadCSV_querydetails($site, $savepath = ".", $tokenUri, 
$tokenDelimiter, $filenamePrefix, $dlUri, $query = "") {
        if (self::IsLoggedIn() === true) {
            $uri = self::SERVICEURI . $tokenUri . "?hl=%s&siteUrl=%s";
            $_uri = sprintf($uri, $this->_language, $site);
            $token = "********";
            $filename = parse_url($site, PHP_URL_HOST) . "-" . date("Ymd-His");
            $finalName = "$savepath/$filenamePrefix-$filename.csv";
            $url =  "hl=%s&siteUrl=%s&security_token=%s&prop=web&db=%s&de=%s&more=true&query=%s&type=URLS&format=csv";
            $_url = self::SERVICEURI . $dlUri . "?" .sprintf($url, $this->_language, rawurlencode($site), $token, $this->_daterange[0], $this->_daterange[1], rawurlencode($query));
            self::SaveData($_url, $finalName);
        } else {
            return false;
        }
    }

I still have a probleme with the recuperation of token :( if you have a 
solution please help

Original comment by mustapha...@gmail.com on 17 Apr 2014 at 4:47

GoogleCodeExporter commented 9 years ago
can i get the impressions per day??? i simply get total count between two date 
ranges.

Original comment by postang...@gmail.com on 18 Jun 2014 at 1:06