Help With Google Parser Results Format

scrapefun

A-Parser Enterprise License
A-Parser Enterprise
I have a preset that checks for multiple types of sites in Google search results that I need help with formatting the code properly.

Currently I check for the presence of forums using this code:


Code:
FOREACH item IN p1.serp;
    IF tools.js.strIndexOf('forum', item.link);
        forumFound = 1;
        BREAK;
    END;

END;

I want to add multiple footprints instead of just checking for "forum" in the url. Here are a few examples:

/threads/
/board/
index.php?topic=
viewtopic.php
board.

How would I add these to the existing code above? Thanks.
 
Most likely it is enough to list all the conditions using logical OR:
Code:
FOREACH item IN p1.serp;
    IF tools.js.strIndexOf('forum', item.link) || tools.js.strIndexOf('/threads/', item.link) || tools.js.strIndexOf('/board/', item.link) || tools.js.strIndexOf('index.php?topic=', item.link) || tools.js.strIndexOf('viewtopic.php', item.link) || tools.js.strIndexOf('board.', item.link);
        forumFound = 1;
        BREAK;
    END;

END;
 
Back
Top