Warning: session_start(): open(/var/lib/php/sessions/sess_0p9ndmjmp7ov0nuj20iiags9nk, 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
!747
m {
static new L entries;
p {
readLocally("entries");
print(entries.size() + " entries in cache. Not consolidated.");
makeAndroid("Snippet Cache Bot.");
}
static synchronized void consolidate() {
new Map byID;
for (S e : entries) {
new Matches m;
if (!find3("snippet *", e, m))
print("Dropping weird entry: " + quote(e));
S id = formatSnippetID(unquote(m.m[0]));
byID.put(id, e);
}
entries = new ArrayList(byID.values());
saveLocally("entries");
}
static synchronized S answer(S s) {
new Matches m;
// new information to store
if (match3("meta * - just got it from the web. snippet * now has md5 * and title *.", s, m)) {
print("New entry: " + structure(m.m));
entries.add(s);
saveLocally("entries");
return "OK, stored.";
}
// other commands
if (match3("please consolidate", s, m)) {
consolidate();
return "OK, consolidated to " + entries.size() + " entries.";
}
return null;
}
}