GHC 2020-06-05

8 comments.

, https://git.io/Jf1gH in jarun/googler
Of course there's another possibility: someone could reverse engineer the `NID` cookie to see if we can generate it without preflight. That someone won't be me though.

, https://git.io/Jf1gQ in jarun/googler
Okay, looked into it. Region settings is persisted through the `NID` cookie. The `NID` cookie comes from a `Set-Cookie` header within the response of a request to https://www.google.com/setprefs with the following query params:

```py
{'sig': ['...'],
 'submit2': ['Save Preferences'],
 'hl': ['en'],
 'lang': ['en'],
 'lr': ['lang_en'],
 'safeui': ['images'],
 'num': ['0'],
 'tts': ['1'],
 'newwindow': ['0'],
 'gl': ['AL'],
 'region': ['AL'],
 'prev': ['https://www.google.com/search?...']}
```

I didn't bother to trace how `sig`'s generated.

So, my assessment: this is possible, but requires a preflight (and a bit of reverse engineering). The result should be cacheable, but googler explicitly promised not to touch the disk, which makes it a much harder decision to make. I'm neutral on whether this should be implemented, but it won't come from me. If you'd like to contribute a patch I'm open to reviewing and polishing it; and @jarun please weigh in on architectural decisions here if possible (no rush).

As for removing this option, I know @jarun uses `-c in` himself to avoid a redirect, so we won't remove it.

, https://git.io/Jf1uh in jarun/googler
Sure, with actionable information I can look into it. Kudos to removing the confrontational bit.

, https://git.io/Jf1uj in jarun/googler
I “don’t even care that results doesn’t change at all” because we’re not in the business of curating results, if different Google domains show you the same results in the browser, googler should show you the same results. We fetch the results and display them, that’s all. And I can tell you the results aren’t always the same, for instance certain things are blocked in certain Google domains on legal grounds but not in others, or at least it used to be the case. So it’s certainly not useless.

But if you have actionable info about why you think it’s about cookies, we’re open to change.

, https://git.io/Jf1ze in jarun/googler
Btw, instead of looking at debug output, you can also use the ‘o’ command in the prompt to open the search results page and confirm you’re on a different version of Google.

, https://git.io/Jf1zv in jarun/googler
If you look at debug output you’ll notice that you’re being connected to google.co.in with -c in, and google.fr with -c fr (if that’s not the case, then you actually hit a bug and we’d like to know that). But other versions of Google returning the same results for most queries is both expected and beyond our control. I think you’re misinterpreting what country-specific search actually does which led to misaligned expectations.

, https://git.io/Jf10B in jarun/googler
The “US-specific” version of Google is just www.google.com, so working as intended. Closing, but let me know if there are follow up questions.

, https://git.io/Jf1Jb in jarun/googler
Need way more details than "does not work". We provide an issue template for a reason. Please go to https://github.com/jarun/googler/issues/new, copy the template, fill it out and edit it into the issue. Let us know when you've done that. Otherwise we'll close the issue in a day.