-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
68 lines (52 loc) · 1.17 KB
/
main.go
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
package main
import (
"fmt"
"github.com/Antosik/rito-news/lol"
)
func Example_LoLNews(locale string, count int) {
client := lol.NewsClient{Locale: locale}
entries, err := client.GetItems(count)
if err != nil {
fmt.Println(err)
return
}
for _, entry := range entries {
fmt.Println(entry)
}
}
func Example_LoLEsportsNews(locale string, count int) {
client := lol.EsportsClient{Locale: locale}
entries, err := client.GetItems(count)
if err != nil {
fmt.Println(err)
return
}
for _, entry := range entries {
fmt.Println(entry)
}
}
func Example_LoLServerStatus(region string, locale string) {
client := lol.StatusClient{Region: region}
entries, err := client.GetItems(locale)
if err != nil {
fmt.Println(err)
return
}
for _, entry := range entries {
fmt.Println(entry)
}
}
func main() {
fmt.Println("Latest League of Legends News")
Example_LoLNews("en-us", 1)
fmt.Println()
fmt.Println("---")
fmt.Println()
fmt.Println("Latest League of Legends Esports News")
Example_LoLEsportsNews("en-us", 1)
fmt.Println()
fmt.Println("---")
fmt.Println()
fmt.Println("Current League of Legends NA Server Status")
Example_LoLServerStatus("na1", "en-US")
}