Warning: session_start(): open(/var/lib/php/sessions/sess_190e0nvkm8vce5a7j2hbrdqvlr, 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
!7
p {
makeBot("Google Image Search.");
centerBigConsole();
clearConsole();
renameConsole(programName());
print("Type what you want to see!");
}
static ImageSurface imageSurface;
static S answer(final S s) {
print("Searching " + quote(s) + "...");
final L urls = googleImageSearch_multi(s);
print("Done - got " + n(urls, "URL"));
int idx = randomIndex(urls);
print("Choosing URL " + (idx+1));
final S url = get(urls, idx);
if (nempty(url)) {
final BufferedImage img = loadImage2(url);
print("Loaded image");
awt {
disposeFrame(imageSurface);
imageSurface = showImage(quote(s), img);
addToWindowAndPack(imageSurface, jbutton("Upload to Database", r-thread {
print("Uploading...");
S imageURL = uploadToImageServer(img, s + " [Google]");
print("Image Uploaded! => " + imageURL);
}));
magiclyFocusConsole();
}
}
ret url;
}