Warning: session_start(): open(/var/lib/php/sessions/sess_0b8dp7d187vdvn8p049hvld2h6, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static int tbSearch_v2_defaultMax = 3;
static new ThreadLocal tbSearch_v2_quick;
static new ThreadLocal tbSearch_v2_html;
static L tbSearch_v2(S query) {
ret tbSearch_v2(tbSearch_v2_defaultMax, query);
}
static L tbSearch_v2(int max, S query) {
bool quick = isTrue(getAndClearThreadLocal(tbSearch_v2_quick));
S url = tb_mainServer() + "/tb/search.php?q=" + urlencode(query) + "&limit=" + max + (quick ? "&quick=1" : "") + standardCredentials();
ret tbSearch_v2_url(url);
}
static L tbSearch_v2_url(S url) {
S page = loadPage(url);
if (eq(tbSearch_v2_html!, "want"))
tbSearch_v2_html.set(page);
new L results;
Matcher m = Pattern.compile("(\w+)").matcher(page);
while (m.find())
results.add(new Snippet(
fsI(m.group(1)),
m.group(2),
null));
m = Pattern.compile(">(#\\d+) - (.*?)
").matcher(page);
while (m.find())
results.add(new Snippet(
m.group(1),
htmldecode(dropTags(m.group(2))),
null)); // no md5 for now
ret results;
}