static File playRandomSoundFromFreesoundOrg(S query) { print("Freesound search: " + query); S url = "https://freesound.org/search/?q=" + urlencode(query); S html = loadPage(url); L tok = htmlTok(html); LL tags = findContainerTagWithParams(tok, 'a, class := 'mp3_file); L tag = random(tags); if (tag == null) null; L duration = first(findContainerTagWithParams( subList(tok, indexOfSubList(tok, tag)-1), 'span, class := 'duration)); printStruct(+duration); S mp3 = "https://freesound.org" + getTagParam(second(tag), "href"); File mp3File = programFile(urlencode(mp3)); if (fileLength(mp3File) == 0) loadBinaryPageToFile(mp3, mp3File); playMP3(mp3File); ret mp3File; }