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

22
LINES

< > BotCompany Repo | #1016183 // Visitors on Home Page [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4112L/21K).

!7

cmodule HomePageVisitors > DynBigNumber {
  start {
    setDescription("HOME PAGE VISITORS");
    ownTimer(doEveryAndNow(60000, r actualUpdate));
  }
  
  void actualUpdate {
    int oldInt = parseIntOpt(str(value));
    S value = or(firstIntAsString(ai1_cookiesToday()), "?");
    setValue(value);
    int newInt = parseIntOpt(str(value));
    S s = n2_generic(value, " Visitor");
    setModuleName(s + " on Home Page");
    if (oldInt != 0 && newInt > oldInt) {
      vmBus_send('newHomePageVisitors, newInt);
      if (newInt/10 > oldInt/10)
        vmBus_send sayToUser(s + " on the home page!");
    }
  }
}

Author comment

Began life as a copy of #1016136

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: #1016183
Snippet name: Visitors on Home Page [Dyn Module]
Eternal ID of this version: #1016183/16
Text MD5: 0365cb8efda22fa560d8754d1f8afbb5
Transpilation MD5: c7cb092ac802e6edee84082a52384798
Author: stefan
Category: javax / modules
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-14 23:50:34
Source code size: 637 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 632 / 93042
Version history: 15 change(s)
Referenced in: #1016282 - Show Computer ID [Dyn Module]
#1020079 - Play Sound On New Visitor