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

15
LINES

< > BotCompany Repo | #1011978 // postToSmartBotsChat - returns true if successful

JavaX fragment (include)

1  
static long postToSmartBotsChat_lastPost = -60000;
2  
static bool postToSmartBotsChat_printStackTrace;
3  
static new ThreadLocal<Bool> postToSmartBotsChat_silently;
4  
5  
static bool postToSmartBotsChat(S text) {
6  
  bool silently = optBoolParam(postToSmartBotsChat_silently);
7  
  if (empty(text)) false;
8  
  if (postToSmartBotsChat_printStackTrace) printStackTrace();
9  
  text = shorten(text, stefansChat_messageLimit());
10  
  if (!silently) print("CHAT>> " + text);
11  
  S url = "http://ai1.space/" + psI(#1011975) + "/raw/msg?botmark=1&message=" + urlencode(text);
12  
  bool ok = eq("OK", silently ? loadPageSilently(url) : loadPage(url));
13  
  postToSmartBotsChat_lastPost = sysNow();
14  
  ret ok;
15  
}

Author comment

Began life as a copy of #1009024

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: #1011978
Snippet name: postToSmartBotsChat - returns true if successful
Eternal ID of this version: #1011978/6
Text MD5: c9149d377cca3826ced23761611c4e45
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-06 22:50:25
Source code size: 683 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 462 / 507
Version history: 5 change(s)
Referenced in: [show references]