Libraryless. Click here for Pure Java version (13701L/91K).
1 | abstract sclass DynGazelleBot > DynPrintLogAndEnabled { |
2 | switchable S gazelleServer = gazelle_server(); |
3 | switchable S _user; |
4 | switchable S _botToken; |
5 | switchable double grabDelay = 0.5; |
6 | new Gazelle_GrabPostsLoop grabLoop; |
7 | |
8 | start { |
9 | addAll(grabLoop.fields, "type", "creating", "postRefs", "postRefTags", "creatorID", "creatorName", "creatorIsMaster", |
10 | "title", "bumped", "botInfo"); |
11 | dm_startThread("Post Grab Loop", r runGrabLoop); |
12 | } |
13 | |
14 | void runGrabLoop { |
15 | dm_copyFieldsToObject(grabLoop, "_user", "_botToken", "enabled"); |
16 | grabLoop.delay = grabDelay; |
17 | grabLoop.server = gazelleServer; |
18 | grabLoop.verbose = true; |
19 | grabLoop.onChange(r change); |
20 | grabLoop.handlePost = post -> enter { handlePost(post); }; |
21 | grabLoop.run(); |
22 | } |
23 | |
24 | swappable void handlePost(GazellePost post) { |
25 | } |
26 | |
27 | void rescan { grabLoop.reset(); } |
28 | |
29 | void enhanceFrame(Container f) { |
30 | super.enhanceFrame(f); |
31 | internalFramePopupMenuItem(f, "Rescan all posts", rEnter rescan); |
32 | } |
33 | } |
Began life as a copy of #1029986
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1029993 |
Snippet name: | DynGazelleBot |
Eternal ID of this version: | #1029993/16 |
Text MD5: | d839edba40c6b2f152c859230d1a3e38 |
Transpilation MD5: | d47e6d99c40da26d05a823b5a1b8729b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-02-04 10:54:46 |
Source code size: | 1035 bytes / 33 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 333 / 661 |
Version history: | 15 change(s) |
Referenced in: | [show references] |