-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForumThreads.java
More file actions
71 lines (60 loc) · 2.58 KB
/
ForumThreads.java
File metadata and controls
71 lines (60 loc) · 2.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
// java examples.forum.ForumThreads YOUR_TOKEN
package examples.forum;
import com.lolzteam.LolzteamClient;
import com.lolzteam.models.*;
public class ForumThreads {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.err.println("Usage: ForumThreads <TOKEN>");
System.exit(1);
}
LolzteamClient client = LolzteamClient.create(args[0]);
var forum = client.forum();
System.out.println("--- threads ---");
ThreadsListResponse threadsResp = forum.threadsList(null, null, null, null, null, null, null, null, null, null, null, null, 5L, null, null, null, null, null);
System.out.println("threads: " + threadsResp.getThreads());
System.out.println("\n--- thread #1 ---");
try {
ThreadsGetResponse resp = forum.threadsGet(1L, null);
System.out.println("thread: " + resp.getThread());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- navigation for #1 ---");
try {
ThreadsNavigationResponse resp = forum.threadsNavigation(1L);
System.out.println("navigation: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- thread #1 followers ---");
try {
ThreadsFollowersResponse resp = forum.threadsFollowers(1L);
System.out.println("followers: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- recent (7d) ---");
try {
ThreadsRecentResponse resp = forum.threadsRecent(7L, 3L, null, null);
System.out.println("recent: " + resp.getThreads());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- followed threads ---");
try {
ThreadsFollowedResponse resp = forum.threadsFollowed(null, null);
System.out.println("followed: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\n--- posts in thread #1 ---");
try {
PostsListResponse resp = forum.postsList(1L, null, null, 3L, null);
System.out.println("posts: " + resp.getPosts());
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\ndone");
}
}