Libraryless. Click here for Pure Java version (15023L/105K).
1 | !7 |
2 | |
3 | module FollowLiveStreamChat > DynPrintLog { |
4 | S videoID = "https://www.youtube.com/watch?v=hGmdFxQ80vE"; |
5 | |
6 | transient S liveStreamID; |
7 | transient S pageToken; |
8 | transient L<YTChatMessage> messages = synchroList(); |
9 | |
10 | start { |
11 | thread "Grab Live Stream Chat" { |
12 | while licensed { |
13 | try { |
14 | setField(liveStreamID := youTubeGetLiveStreamID(videoID)); |
15 | while licensed { |
16 | YTChatMessages result = youTubeGetChatMessages(liveStreamID, pageToken); |
17 | programLogStruct(result); |
18 | if (nempty(result.messages)) |
19 | print("Got " + n2(result.messages, "message") + " from live stream chat"); |
20 | for (YTChatMessage msg : result.messages) { |
21 | print("> " + msg.publishedAt + " [" + msg.authorDisplayName + "] " + msg.text); |
22 | vmBus_send('gotYouTubeLiveStreamMessage, msg); |
23 | } |
24 | pageToken = result.nextPageToken; |
25 | sleep(result.pollingIntervalMillis + 1000); |
26 | } |
27 | } on fail { |
28 | sleepSeconds(10.0); |
29 | } |
30 | } |
31 | } |
32 | } |
33 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020364 |
Snippet name: | Follow YouTube Live Stream Chat Messages [OK] |
Eternal ID of this version: | #1020364/11 |
Text MD5: | 6f1f6684b56824b98ec9083950779678 |
Transpilation MD5: | 20aee54392b50c2d8c62795c6dbaff9e |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-16 22:46:11 |
Source code size: | 1104 bytes / 33 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 387 / 579 |
Version history: | 10 change(s) |
Referenced in: | [show references] |