**WORK IN PROGRESS** golang API client for interacting with the jschan imageboard API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
760 B

package main
import (
"context"
"fmt"
"jschan/app"
)
func main() {
jschanClient := jschan.NewClient("https://fatchan.org")
ctx := context.Background()
loginOptions := &jschan.PostLoginOptions{
Username: "",
Password: "",
Twofactor: "",
}
err := jschanClient.Login(ctx, loginOptions)
if err != nil {
fmt.Println(err)
return
}
overboardOptions := &jschan.GetOverboardOptions{
IncludeDefault: true,
}
res, err := jschanClient.GetOverboardCatalog(ctx, overboardOptions)
if err != nil {
fmt.Println(err)
return
}
if len(res.Threads) > 0 {
firstThread := res.Threads[0]
fmt.Printf("Name = %s\n", firstThread.Name)
fmt.Printf("Message = %s\n", firstThread.Nomarkup)
} else {
fmt.Println("No threads")
}
return
}