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

24
LINES

< > BotCompany Repo | #1017616 // Read Telegram Mech Log Spike [OK]

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

Download Jar. Libraryless. Click here for Pure Java version (8644L/62K).

!7

p-exp {
  long lastDate = 0, lastOriginalDate = 0;
  new L<TelegramMsg> msgs;
  for (S s : mL("Telegram Bot Log")) pcall {
    Map map = safeUnstructureMap(s);
    S type = cast map.get('type);
    S text = cast map.get('text);
    long originalDate = toInt(map.get('originalDate))*1000L;
    long date = parseLocalDateWithMilliseconds_orKeepLong(map.get('date));
    if (originalDate != 0) print("diff: " + (date-originalDate));
    print("Type: " + type + ", date diff: " + (date-lastDate) + "/" + (date-lastOriginalDate) + "/" + (originalDate-lastDate) + ", text: " + quote(text));
    msgs.add(nu(TelegramMsg, +date, +originalDate, +text,
      firstName := map.get('userFirstName), 
      lastName := map.get('userLastName), 
      userID := toInt(map.get('userID)),
      sent := eq(type, 'sent),
      globalID := map.get('globalID)));
    lastDate = date;
    lastOriginalDate = originalDate;
  }
  pnlStruct(msgs);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017616
Snippet name: Read Telegram Mech Log Spike [OK]
Eternal ID of this version: #1017616/11
Text MD5: 700bba6a55e15b92779bed045d9b32e7
Transpilation MD5: 6c094b9b372606538d290f3ca8909516
Author: stefan
Category: javax / networking
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-30 21:40:02
Source code size: 952 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 1565 / 1154
Version history: 10 change(s)
Referenced in: [show references]