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

21
LINES

< > BotCompany Repo | #1011979 // Upload webcam image to Smart Bot's Chat [WORKS, uses JPG]

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

Uses 6469K of libraries. Click here for Pure Java version (7841L/53K/194K).

1  
!7
2  
3  
p-subst {
4  
  BufferedImage img = cast time(f singleImagePreferablyFromLastWebcam);
5  
  if (img == null) { infoBox("Got no image"); ret; }
6  
  ImageSurface is = showImage("Will upload in 3! Close window to stop this.", img);
7  
  hideConsole();
8  
  sleepSeconds(3);
9  
  if (!is.isShowing()) {
10  
    infoBox("Upload cancelled.");
11  
    ret;
12  
  }
13  
  setFrameTitle(is, "Uploading...");
14  
  S imageURL = uploadJPEGToImageServer(img, "User webcam image");
15  
  print("Image uploaded as " + imageURL);
16  
  setFrameTitle(is, "Posting...");
17  
  if (postToSmartBotsChat("[IMAGE] " + imageURL))
18  
    setFrameTitle(is, print("Posted image to chat!"));
19  
  else
20  
    setFrameTitle(is, print("Could not post image."));
21  
}

Author comment

Began life as a copy of #1009033

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011979
Snippet name: Upload webcam image to Smart Bot's Chat [WORKS, uses JPG]
Eternal ID of this version: #1011979/1
Text MD5: 391f99cb265c88b2844c740c0309a58a
Transpilation MD5: 00e564478c9e7f84ea63c12e14ef43fb
Author: stefan
Category: javax / desktop / camera
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-14 03:42:13
Source code size: 699 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 367 / 482
Referenced in: [show references]