Bug 430643 - BBC weather location search returns no matches
Summary: BBC weather location search returns no matches
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: DataEngines (show other bugs)
Version: 5.20.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-21 00:31 UTC by Joe Dight
Modified: 2021-06-10 17:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Dight 2020-12-21 00:31:42 UTC
SUMMARY
Searching for a location with the Weather Report widget returns no results using the BBC weather provider. Other providers work correctly.

https://invent.kde.org/plasma/plasma-workspace/-/blob/a36ffb6970fd644cf6034f78fa1467e69353d051/dataengines/weather/ions/bbcukmet/ion_bbcukmet.cpp#L327 seems to try http://www.bbc.com/locator/default/en-GB/search.json?search=hull&filter=international&postcode_unit=false&postcode_district=true which is a 404 for me in a browser.
(Sorry if I'm wrong here, I'm no expert)

STEPS TO REPRODUCE
1. Add weather widget to desktop, click configure.
2. Click choose location, select BBC Weather only, search for Hull (or anywhere else).

OBSERVED RESULT
'No weather stations found'

EXPECTED RESULT
The correct stations are displayed.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.1
Kernel Version: 5.9.9
OS Type: 64-bit
Processors: 8 × Intel® Core™ i5-8265U CPU @ 1.60GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 1 Chris Holland 2021-01-03 14:19:50 UTC
The website (https://www.bbc.com/weather) fetches:

https://locator-service.api.bbci.co.uk/locations?api_key=AGbFAKx58hyjQScCXIYrxuEwJh2W2cmv&stack=aws&locale=en&filter=international&place-types=settlement,airport,district&order=importance&s=london&a=true&format=json

The API Key (AGbFAKx58hyjQScCXIYrxuEwJh2W2cmv) can be found in the attribute of this element:

<div class="wr-c-location-search-and-setting wr-c-location-search-and-setting--masthead" role="search" id="wr-location-search-params" data-forecast-page-url-template="/weather/{{location_id}}" data-edition="international" data-environment="live" data-locator-key="AGbFAKx58hyjQScCXIYrxuEwJh2W2cmv" data-uas-key="iofba4k90pgap" lang="en">...</div>

However we should probably see if there's a way to register our own key.
Comment 2 kdebugs 2021-02-05 16:42:20 UTC
I looked into this, and there are a couple of options that don't need an API key.

The easiest (utterly undocumented) seems to be this: https://open.live.bbc.co.uk/locator/locations?s=London&format=json

The ids seem to be geonames, so you could also use their api described here: https://www.geonames.org/export/geonames-search.html
Comment 3 Paul McAuley 2021-02-21 11:01:26 UTC
How about adding the UK Met Office as an alternate source to the BBC? I created a wishlist request in bug 433377. I'm not sure if I put that bug in the correct category though.
Comment 4 Bug Janitor Service 2021-06-10 13:24:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/922
Comment 5 Bug Janitor Service 2021-06-10 16:12:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/925
Comment 6 Joe Dight 2021-06-10 17:49:37 UTC
Git commit 500e061366c66e2537f83278585717779addd63b by Joe Dight.
Committed on 10/06/2021 at 17:45.
Pushed by ngraham into branch 'master'.

Point bbcukmet to new location API

M  +8    -7    dataengines/weather/ions/bbcukmet/ion_bbcukmet.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/500e061366c66e2537f83278585717779addd63b
Comment 7 Nate Graham 2021-06-10 17:50:02 UTC
Git commit 398762cf8763d56c5b6d6ce21ff29d30f3bb98d3 by Nate Graham, on behalf of Joe Dight.
Committed on 10/06/2021 at 17:49.
Pushed by ngraham into branch 'Plasma/5.22'.

Point bbcukmet to new location API


(cherry picked from commit 500e061366c66e2537f83278585717779addd63b)

M  +8    -7    dataengines/weather/ions/bbcukmet/ion_bbcukmet.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/398762cf8763d56c5b6d6ce21ff29d30f3bb98d3