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

18
LINES

< > BotCompany Repo | #1012093 // smartBotsChat_readArchive

JavaX fragment (include)

1  
please include function smartBotsChat_onLine.
2  
3  
static L<ChatMsg> smartBotsChat_readArchive() {
4  
  ret smartBotsChat_readArchive(1000*1000);
5  
}
6  
7  
// n = max number of lines to get (from most recent)
8  
static L<ChatMsg> smartBotsChat_readArchive(int n) {
9  
  int b = smartBotsChat_onLine_firstRead;
10  
  if (b < 0) b = smartBotsChat_n();
11  
  int a = max(0, b-n);
12  
  ret smartBotsChat_readArchive(a, b);
13  
}
14  
  
15  
static L<ChatMsg> smartBotsChat_readArchive(int a, int b) {
16  
  L<Map> msgs = (L) safeUnstruct(loadPage("http://ai1.space/1011975/raw/archive-from-to?a=" + a + "&b=" + b));
17  
  ret mapsToObjects(msgs, ChatMsg);
18  
}

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: 557 / 580
Version history: 3 change(s)
Referenced in: [show references]