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

18
LINES

< > BotCompany Repo | #1010965 // stefansChat_readArchive

JavaX fragment (include)

please include function stefansChat_onLine.

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

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

Author comment

Began life as a copy of #1010816

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: #1010965
Snippet name: stefansChat_readArchive
Eternal ID of this version: #1010965/3
Text MD5: e241d3dd6960211de25d6834869ef5ce
Author: stefan
Category: javax / chat
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-14 21:27:23
Source code size: 600 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 417 / 480
Version history: 2 change(s)
Referenced in: [show references]