11

I mean, i can specify preferred SERP location search options on google serp page, for sure. I guess there is way to make it hapenns with curl.

Here is some history. I've used SEOStats onto my project. It's good. The I've got interesting article about local searches with undocumented google search parameter UULE, and used it for getting local results. And it works fine for some time. Then I've to implement getting results with proxies. And that's it. Something is going wrong today as suggested in this comment at the same article. This year is full of surprises. Results now ignoring parameter UULE for some reason sometimes using proxy. It returns me proxy located local results. But it's partially fine without proxy.

So, I have to guess.

Should make an additional request every time with same (I have back engineered this, look at code below) user processes setting current location OR may be i have missed some request headers OR is there simpliest way and I am kinda stupid?

// Setting location like a boss
$randomKey = mt_rand(1111,999999);          

// SEOStats Curl wrapper
$test = static::gCurl("?q=testing" . $randomKey . "#q=testing". $randomKey, false, Config\DefaultSettings::ALLOW_GOOGLE_COOKIES, $proxy );

$q = explode(";;--;;", $test);
preg_match("/;sig=(.*?)\"/i", $test, $out);
$key = $out[1];

//Suggested Google Geocoder location
$zc = (!empty($location)) ? urlencode($location) : urlencode("Home sweet home");
$url = "https://www.google." . Config\DefaultSettings::GOOGLE_TLD . "/" . "uul?muul=4_18&luul=$zc&uulo=1&usg=$key&hl=ru";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

// There should be magic not tested yet
Machavity
  • 30,841
  • 27
  • 92
  • 100
Andrew Rumm
  • 1,268
  • 4
  • 16
  • 39

1 Answers1

2

Yes you can, you should use the local domain (which you already use) and the cr GET parameter to set the default country along with a matching hl parameter to set the default language.

Then you get URL's like:

https://www.google.nl/search?cr=countryNL&hl=nl&num=50&q={your keyword}
redelschaap
  • 2,774
  • 2
  • 19
  • 32
  • It's not about country, it's about cities in coutries. It's more local. I mean what it all about Russia? SERPs with Pizza request in Moscow or Saint-Petersburg are not the same. They are totally different. THis is the point of my question. – Andrew Rumm May 30 '15 at 07:10
  • That's clear now, thank you. Can you tell me what values you are using for the uule parameter? – redelschaap May 30 '15 at 07:28
  • Some local nearby cities. Rostov-on-Don and Krasnodar was coded into uule. – Andrew Rumm May 31 '15 at 03:09
  • Yes I understand that, but how did you build the uule parameters? – redelschaap May 31 '15 at 07:07
  • One of comments on same article provides helper. – Andrew Rumm May 31 '15 at 17:38
  • That function seems right. Is it working when you use one of those values in your browser? Like when you just browse to `https://www.google.nl/search?q=keyword&uule=w+CAIQICI{secret key}{base64 encoded place, region, country}`? I would suggest to use place, region and country in the given `hl` language, but English must also work. – redelschaap May 31 '15 at 17:54
  • I used it a while ago and I got the right results back then. To verify this method still works I just tried myself and I get local results with the right `uule` parameter. – redelschaap May 31 '15 at 18:19
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/79266/discussion-between-redelschaap-and-rayz). – redelschaap May 31 '15 at 18:22