getSearchResults order? Does it matter
#1
Hi, in the scraper I am writing it returns a list of results. I would have assumed that the scraper would then choose the first item in the list but this is not the case.

Is there a way to control which item in the list the scraper chooses? Seems out of the scope of our functions.

Example: When searching for "UFC 3" my scraper returns (formatted for readability):
Code:
13:56:40 T:8204   DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="UTF-8" standalone="yes"?><results>
    <entity><title>UFC 3 - The American Dream (09-Sep-1994)</title><url>http://www.sherdog.com/events/UFC-3-The-American-Dream-9</url></entity>
    <entity><title>UFC 25 - Ultimate Japan 3 (14-Apr-2000)</title><url>http://www.sherdog.com/events/UFC-25-Ultimate-Japan-3-35</url></entity>
    <entity><title>UFC 30 - Battle on the Boardwalk (23-Feb-2001)</title><url>http://www.sherdog.com/events/UFC-30-Battle-on-the-Boardwalk-40</url></entity>
    <entity><title>UFC 31 - Locked & Loaded (04-May-2001)</title><url>http://www.sherdog.com/events/UFC-31-Locked-Loaded-282</url></entity>
    <entity><title>UFC 32 - Showdown in the Meadowlands (29-Jun-2001)</title><url>http://www.sherdog.com/events/UFC-32-Showdown-in-the-Meadowlands-429</url></entity>
    <entity><title>UFC 33 - Victory in Vegas (28-Sep-2001)</title><url>http://www.sherdog.com/events/UFC-33-Victory-in-Vegas-430</url></entity>
    <entity><title>UFC 34 - High Voltage (02-Nov-2001)</title><url>http://www.sherdog.com/events/UFC-34-High-Voltage-540</url></entity>
    <entity><title>UFC 35 - Throwdown (11-Jan-2002)</title><url>http://www.sherdog.com/events/UFC-35-Throwdown-668</url></entity>
    <entity><title>UFC 36 - Worlds Collide (22-Mar-2002)</title><url>http://www.sherdog.com/events/UFC-36-Worlds-Collide-771</url></entity>
    <entity><title>UFC 37 - High Impact (10-May-2002)</title><url>http://www.sherdog.com/events/UFC-37-High-Impact-850</url></entity>
</results>

But for some reason XBMC is choosing the 2nd one in the list as shown by the next log lines:
Code:
13:56:40 T:8204   DEBUG: ADDON::CScraper::GetVideoDetails: Reading movie 'http://www.sherdog.com/events/UFC-25-Ultimate-Japan-3-35' using MMA Sherdog Metadata scraper (file: 'C:\Users\me\AppData\Roaming\XBMC\addons\metadata.mma.sherdog', content: 'movies', version: '0.2')
13:56:40 T:8204   DEBUG: CurlFile::Open(0F3C4DB0) http://www.sherdog.com/events/UFC-25-Ultimate-Japan-3-35

So I'd really like to make the scraper take the 1st result, which is quite accurate on sherdog. Thanks.

It does seem to be favouring the 2nd item in the list when there are several of them...
Reply
#2
XBMC will automatically perform a fuzzy sort on the results by comparing the titles to the one it originally passed to the scraper (If you include a <year> with the results, that will also factor).

Not that this fully explains the one it decides to pick in this case - it's probably a case of "fewer mismatching characters" or something.

To prevent it, just add sorted="yes" to the results tag.
Reply
#3
Thanks heaps, working a treat now.
Reply

Logout Mark Read Team Forum Stats Members Help
getSearchResults order? Does it matter0