Sharing data between getSearchUrl and getDetails - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Scrapers (https://forum.kodi.tv/forumdisplay.php?fid=60) +--- Thread: Sharing data between getSearchUrl and getDetails (/showthread.php?tid=162623) |
Sharing data between getSearchUrl and getDetails - budswell - 2013-04-17 Hi, I am writing an MMA scraper from sherdog.com Is there any way I can set variable in the getSearchUrl function which I can later use in getDetails. For testing I tried: Set buffer 7 in getSearchUrl Code: <RegExp input="$$4" output=" BOGUS" dest="7"> Append it to the title in getDetails Code: <RegExp input="$$1" output="<title>\1[$$7]</title><originaltitle>\1[$$7]</originaltitle><year>\2</year>" dest="6"> But the title is just getting [] appended to it. i.e. $$7 is the empty string. So from this can I assume that all the $$ buffers are reset for each function call. e.g. $$1 is input parameter and all others are cleared (although $$2 is apparently used by some functions - doco?). So is there any other way I can share this data? Other variable names? Is it even possible from a threading/control flow point of view? Background: The reason I want this is that I sometimes have 2 for an MMA event. e.g. Code: UFC-148.avi RE: Sharing data between getSearchUrl and getDetails - scudlee - 2013-04-17 Basically, you want to add clearbuffers="no" into the function you don't want the buffers clearing after it's run. So, Code: <GetSearchResults clearbuffers="no" dest="3"> (Just remember to use clear="yes" in the expression if you re-use a buffer, and don't want the old contents appearing if there's no match.) RE: Sharing data between getSearchUrl and getDetails - budswell - 2013-04-18 Thanks. I had to set the clearbuffers="no" on both the getSearchUrl and getSearchResults. Which made sense once I thought about it. Its all working now, very much appreciated. |