Time for action – setting up the Media card scripts
Copy the functions you proved to work in the test stack script, and paste them into WebScraper stack script. Then…
Go to the Media card. As with the Links card we're not going to add any controls to the card, we'll do that with script. So, edit the card script.
Here is the Media card's
init
function, and needed global variables:global gPageHTML,gMediaList on init if the platform is "iphone" or the platform is "android" then put getMedia(gPageHTML) into gMediaList if the number of lines in gMediaList = 0 then answer "There is no media in this page!" else set the itemdelimiter to "/" put empty into tMediaNames repeat with a = 1 to the number of lines in gMediaList put the last item of line a of gMediaList into line a of tMediaNames end repeat mobilePick tMediaNames,1 if the result > 0 then put the result into tMediaLine ...