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

18
LINES

< > BotCompany Repo | #1012093 // smartBotsChat_readArchive

JavaX fragment (include)

please include function smartBotsChat_onLine.

static L<ChatMsg> smartBotsChat_readArchive() {
  ret smartBotsChat_readArchive(1000*1000);
}

// n = max number of lines to get (from most recent)
static L<ChatMsg> smartBotsChat_readArchive(int n) {
  int b = smartBotsChat_onLine_firstRead;
  if (b < 0) b = smartBotsChat_n();
  int a = max(0, b-n);
  ret smartBotsChat_readArchive(a, b);
}
  
static L<ChatMsg> smartBotsChat_readArchive(int a, int b) {
  L<Map> msgs = (L) safeUnstruct(loadPage("http://ai1.space/1011975/raw/archive-from-to?a=" + a + "&b=" + b));
  ret mapsToObjects(msgs, ChatMsg);
}

Author comment

Began life as a copy of #1010965

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: #1012093
Snippet name: smartBotsChat_readArchive
Eternal ID of this version: #1012093/4
Text MD5: e64770bdafa762f0bd736f58ee61aeac
Author: stefan
Category: javax / chat
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-15 15:58:23
Source code size: 618 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 556 / 579
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1013010 - smartBotsChatLine - get text of a single line
#1013921 - smartBotsChat_regexp