-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
53 lines (45 loc) · 1.06 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
package main
import (
"fmt"
"log"
"github.com/anond0rf/vecchioclient/client"
)
func main() {
vc := client.NewVecchioClient()
// POSTING NEW THREAD
thread := client.Thread{
Board: "b",
Name: "",
Subject: "",
Email: "",
Spoiler: false,
Body: "This is a new thread on board /b/",
Embed: "",
Password: "",
Sage: false,
Files: []string{`C:\path\to\image1.jpg`, `C:\path\to\image2.png`},
}
id, err := vc.NewThread(thread)
if err != nil {
log.Fatalf("Unable to post thread %+v. Error: %v\n", thread, err)
}
fmt.Printf("Thread posted successfully (id: %d) - %+v\n", id, thread)
// POSTING REPLY
reply := client.Reply{
Thread: 1,
Board: "b",
Name: "",
Email: "",
Spoiler: false,
Body: "This is a new reply to thread #1 of board /b/",
Embed: "",
Password: "",
Sage: false,
Files: []string{},
}
id, err = vc.PostReply(reply)
if err != nil {
log.Fatalf("Unable to post reply %+v. Error: %v\n", reply, err)
}
fmt.Printf("Reply posted successfully (id: %d) - %+v\n", id, reply)
}