Help with scraping OOTB component
Trying to scrape recommendations component using :
<#assign markup>
<@delegate />
</#assign>
${markup}
<#-- LOGIC -->
<#assign ids = [] />
<#assign idmatches = markup?matches("-p\\/(\\d+)") />
<#list idmatches as id>
<#-- only add an id once -->
<#-- the ?groups build-in contains a sequence with [0] = the whole match
and [0+groupn] items with their match, in this case the <topicid> -->
<#if !ids?seq_contains(id?groups[1])>
<#assign ids = ids + [id?groups[1]]/>
</#if>
</#list>
<#-- DISPLAY -->
<#if markup?contains("Recommendations")>
<span>RC</span>
<#list ids as id>
<#assign convo = rest("2.0", "/search?q=" + "select subject,board,replies.count(*) from messages where id='${id}'"?url).data.items[0]/>
${convo.subject}
${convo.board.id}
${convo.replies.count}
</#list>
</#if>
Which works but I want to omit the need for "${markup}" without which I'm unable to get the HTML on DOM in order to get the data (the topic ids basically)