Opened 10 years ago

Closed 10 years ago

#7999 closed defect (fixed)

'uk_bbc' fails to return single search results

Reported by: Mike Parker <michael.parker@…> 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)

BBCLocation.patch (2.3 KB) - added by Mike Parker <michael.parker@…> 10 years ago.
BBCLocation.pm patch file

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Mike Parker <michael.parker@…>

Attachment: BBCLocation.patch added

BBCLocation.pm patch file

comment:1 Changed 10 years ago by paulh

Milestone: unknown0.23
Owner: changed from Isaac Richards to paulh
Status: newaccepted
Version: 0.22-fixeshead

comment:2 Changed 10 years ago by paulh

Resolution: fixed
Status: acceptedclosed

(In [23732]) Improved location searching in the 'uk_bbc' MythWeather? scripts. Patch by Mike Parker. Fixes #7999.

Note: See TracTickets for help on using tickets.