static double stefansChat_onLine_safetyDelay = 1; // f : voidfunc(text) static void stefansChat_onLine(O f) { thread "Stefan's Chat" { int a = toInt(loadPage("http://ai1.lol/1008998/raw/n")); while licensed { S s = loadPage("http://ai1.lol/1008998/raw/incremental?json=1&a=" + a); if (empty(trim(s))) { sleepSeconds(stefansChat_onLine_safetyDelay); print("Re-polling."); continue; } int n = getInt(map, 'n); L msgs = cast get(map, 'msgs); for (O msg : msgs) pcallF(f, getString(msg, 'text)); a = n; } } }