-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForumMisc.java
More file actions
101 lines (87 loc) · 3.58 KB
/
ForumMisc.java
File metadata and controls
101 lines (87 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// java examples.forum.ForumMisc YOUR_TOKEN
//
// Уведомления, переписки, чатбокс, теги и т.д.
package examples.forum;
import com.lolzteam.LolzteamClient;
import com.lolzteam.models.*;
public class ForumMisc {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.err.println("Usage: ForumMisc <TOKEN>");
System.exit(1);
}
LolzteamClient client = LolzteamClient.create(args[0]);
var forum = client.forum();
System.out.println("--- notifications ---");
try {
NotificationsListResponse resp = forum.notificationsList(null, null, 5L);
System.out.println("notifications: " + resp.getNotifications());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- conversations ---");
try {
ConversationsListResponse resp = forum.conversationsList(null, null, 5L);
System.out.println("conversations: " + resp.getConversations());
} catch (Exception e) {
System.err.println(" skip (может быть 403): " + e.getMessage());
}
System.out.println("\n--- chatbox ---");
try {
ChatboxIndexResponse resp = forum.chatboxIndex(null);
System.out.println("chatbox: " + resp.getRooms());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- chatbox leaderboard ---");
try {
ChatboxGetLeaderboardResponse resp = forum.chatboxGetLeaderboard(null);
System.out.println("leaderboard: " + resp.getLeaderboard());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- popular tags ---");
try {
TagsPopularResponse resp = forum.tagsPopular();
System.out.println("tags: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- tags search: cs ---");
try {
TagsFindResponse resp = forum.tagsFind("cs");
System.out.println("found: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- forms ---");
try {
FormsListResponse resp = forum.formsList(null);
System.out.println("forms: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- feed options ---");
try {
ForumsGetFeedOptionsResponse resp = forum.forumsGetFeedOptions();
System.out.println("feed options: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- ignored users ---");
try {
UsersIgnoredResponse resp = forum.usersIgnored(null);
System.out.println("ignored: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- my likes ---");
try {
UsersLikesResponse resp = forum.usersLikes(1L, null, null, null, null, null, null, null);
System.out.println("likes: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\ndone");
}
}