duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Forecast Spice: Wrong location? #893

Closed moollaza closed 7 years ago

moollaza commented 10 years ago

From Duck.co, https://duck.co/forum/thread/7105/location-tracking-not-working

When I search weather on duckduckgo it gives me weather for kriens Switzerland. When I search where am I it gives my correct location (Wellington, New Zealand).


IA Page: https://duck.co/ia/view/forecast

p16i commented 10 years ago

screenshot 2014-07-20 23 14 01

screenshot 2014-07-20 23 14 09

I'll look into this issue.

moollaza commented 10 years ago

@heytitle awesome, thanks!

Let us know if you run into any problems

jagtalon commented 10 years ago

@heytitle Those are really far from each other! We're working on a better fix for the weather relevancy, so that shouldn't come up next time.

p16i commented 10 years ago

After investigating, I found that the problem seems to come from DDG::Location which transtate IP to postal code incorrectly as far as I can see. REF: https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Forecast.pm#L73

Requested from Bangkok, Thailand: 58.8.17.47 screenshot 2014-07-27 23 09 11 screenshot 2014-07-27 23 10 45

p16i commented 10 years ago

I've got the idea from where am i goodie which return my location correctly.

I think if we change this line to

$location = $loc->latitude.','.$loc->longitude;

which propably solve the problem. Further more, I've tested my solution by sending lat,long to the api, which return me a satisfied result.

https://duckduckgo.com/js/spice/forecast/,/current

I would be appreciated if you guys tell me how to make Forecast spice work locally. I can't trigger it for some reason.

moollaza commented 10 years ago

@russellholt it looks like we originally used the lat/long and then switched to the loc_str (https://github.com/duckduckgo/zeroclickinfo-spice/commit/6b9dd4326678431c722a15d1e764b88d0220102f) -- do you remember what the reason was? Any thoughts on switching back?

p16i commented 10 years ago

@moollaza Do you have any ideas how to fix it?

russellholt commented 10 years ago

it's a privacy leak to send lat,long.

jagtalon commented 10 years ago

@russellholt Isn't the lat-lon just as accurate as join(", "$loc->city, $loc->region_name, $loc->country_name);? It doesn't really get the user's location--it gets the ISP's location.

javathunderman commented 9 years ago

@moollaza Seems like this is still an issue.

joaquinlpereyra commented 7 years ago

Confirming this is still an issue.

Where I am correctly states 'Buenos Aires', weather giving me weather for a little-known city called Federal some 1.000 kilometers north.

moollaza commented 7 years ago

Closing. Duplicate of #899