controller_FetchMatchData

This function searches the sitemap.json for the domain controller.livecode.wiki for a match

function controller_FetchMatchData pProt, pPort put "controller.livecode.wiki" into wDom # Construct regExp put regExp_fromLinkKey ("Rex") into rExp get wikiSite_MatchData (rExp, wDom, pProt, pPort) return it end controller_FetchMatchData

Where the function wikiSite_MatchData returns an array `matchData` with each item containing iArray corresponging to the data found in sitemap.json:

function wikiSite_MatchData rExp, wDom,pProt,pPort get fedwiki_FetchSitemapArray (wDom,pProt,pPort) put 1 into mNum put item 2 of the extents of it into maxNum repeat with iNum = 1 to maxNum put it [iNum] into iArray -- put iArray ["synopsis"] into firstLine try if matchText (firstLine, regExp) then put iNum into iArray ["iNum"] put iArray into matchData [mNum] add 1 to mNum end if catch e -- problem with provided regExp end try end repeat return matchData end wikiSite_MatchData