-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.java
More file actions
52 lines (44 loc) · 1.88 KB
/
Basic.java
File metadata and controls
52 lines (44 loc) · 1.88 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
// java examples.general.Basic YOUR_TOKEN
package examples.general;
import com.lolzteam.LolzteamClient;
import com.lolzteam.models.*;
public class Basic {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.err.println("Usage: Basic <TOKEN>");
System.exit(1);
}
String token = args[0];
LolzteamClient client = LolzteamClient.create(token);
System.out.println("--- forum: user #1 ---");
try {
UsersGetResponse resp = client.forum().usersGet(1L, null);
User user = resp.getUser();
System.out.println("username: " + user.getUsername());
System.out.println("registered: " + user.getUserRegisterDate());
} catch (Exception e) {
System.err.println("err: " + e.getMessage());
}
System.out.println("\n--- forum: categories ---");
try {
CategoriesListResponse cats = client.forum().categoriesList(null, null, null);
System.out.println("categories: " + cats.getCategories());
} catch (Exception e) {
System.err.println("err: " + e.getMessage());
}
System.out.println("\n--- market: categories ---");
try {
CategoryListResponse cats = client.market().categoryList(null);
System.out.println("categories: " + cats);
} catch (Exception e) {
System.err.println("err: " + e.getMessage());
}
System.out.println("\n--- market: payment history ---");
try {
PaymentsHistoryResponse payments = client.market().paymentsHistory(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
System.out.println("payments: " + payments);
} catch (Exception e) {
System.err.println("err: " + e.getMessage());
}
}
}