Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1005000 // Test Google Image Search

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 616K of libraries. Click here for Pure Java version (5211L/36K/118K).

!752

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 S url = googleImageSearch(s);
  print("Done.");
  if (nempty(url)) awt {
    disposeFrame(imageSurface);
    final BufferedImage img = loadImage2(url);
    imageSurface = showImage(quote(s), img);
    addToWindowAndPack(imageSurface, jbutton("Upload to Database", r {
      JTextField tf = new JTextField(s);
      /*showTitledForm("Upload to Database",
        "Name", tf,
        r {*/
          S imageURL = uploadToImageServer(img, s + " [Google]");
          print("Image Uploaded! => " + imageURL);
        //});
    }));
    magiclyFocusConsole();
  }
  ret url;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005000
Snippet name: Test Google Image Search
Eternal ID of this version: #1005000/1
Text MD5: 9b5f9cd202c6cf36b8f8eeb00d925920
Transpilation MD5: 98d7b25a36f65370ace234a7c0e3ecca
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-22 23:14:01
Source code size: 876 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 680 / 719
Referenced in: #1007141 - Test Google Image Search v2