Nana Unofficial API
$ go get github.com/nanato12/nanago
import (
"github.com/nanato12/nanago/nana"
)
Create new Nana account.
Email address and password will be randomly determined when empty.
client, err := nana.CreateAccount(mailAdress, password)
There are two ways to log in.
- MailAddress & Password Login.
client, err := nana.Login(mailAddress, password)
- Token Login
client, err := nana.LoginByToken(token)
fmt.Println("[ID]", client.ID, "[NAME]", client.Name, "[TOKEN]", client.Token)
res, err := client.GetMyInfo()
fmt.Println(res)
Follow user by UserID
.
res, err := client.Follow(userID)
Play post by PostID
res, err := client.PlayPost(postID)
Applause post by PostID
res, err := client.ApplausePost(postID)
Comment on post by PostID
res, err := client.CommentPost(postID, comment)
Join community by CommunityID
res, err := client.JoinCommunity(communityID)
Create account and follow user.
const (
YourUserID = "XXXXXXXXXX"
)
func main() {
client, err := nana.CreateAccount("", "")
if err != nil {
fmt.Println(err)
}
fmt.Println("[ID]", client.ID, "[NAME]", client.Name)
if _, err := client.Follow(YourUserID); err != nil {
fmt.Println(err)
return
}
}