Opened 14 years ago
Closed 14 years ago
#7999 closed defect (fixed)
'uk_bbc' fails to return single search results
Reported by: | Owned by: | paulh | |
---|---|---|---|
Priority: | minor | Milestone: | 0.23 |
Component: | Plugin - MythWeather | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
The 'uk_bbc' search scripts are failing to return hits when the underlying query of the BBC website only returns a single match.
E.g.
./bbccurrentxml.pl -l bristol
currently returns nothing since BBCLocation::parseResults is only looking for the <p class="response"> tag associated with the return of multiple hits. HTML data coming from the BBC does not contain such tags when only a single search hit is found.
In contrast:
./bbccurrentxml.pl -l london
successfully returns several results since the <p class="response"> tags are present.
The attached patch file corrects this behaviour by looking for the "Print <location>" link within the returned HTML. This link is present irrespective of the number of hits returned. Where multiple hits are returned, the locationID and location extracted from the "Print" link are added to (and overwritten by, if necessary) the results parsed from the <p class="response"> section.
Attachments (1)
Change History (3)
Changed 14 years ago by
Attachment: | BBCLocation.patch added |
---|
comment:1 Changed 14 years ago by
Milestone: | unknown → 0.23 |
---|---|
Owner: | changed from Isaac Richards to paulh |
Status: | new → accepted |
Version: | 0.22-fixes → head |
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
(In [23732]) Improved location searching in the 'uk_bbc' MythWeather? scripts. Patch by Mike Parker. Fixes #7999.
BBCLocation.pm patch file