Skip to content

nanato12/nanago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanago

Nana Unofficial API

go get

$ go get github.com/nanato12/nanago

import

import (
    "github.com/nanato12/nanago/nana"
)

CreateAccount

Create new Nana account.
Email address and password will be randomly determined when empty.

client, err := nana.CreateAccount(mailAdress, password)

Login

There are two ways to log in.

  • MailAddress & Password Login.
client, err := nana.Login(mailAddress, password)
  • Token Login
client, err := nana.LoginByToken(token)

Client Information

fmt.Println("[ID]", client.ID, "[NAME]", client.Name, "[TOKEN]", client.Token)

Account Information

res, err := client.GetMyInfo()
fmt.Println(res)

Follow User 🙆

Follow user by UserID.

res, err := client.Follow(userID)

Play Post ▶️

Play post by PostID

res, err := client.PlayPost(postID)

Applause Post 👏

Applause post by PostID

res, err := client.ApplausePost(postID)

Comment on Post 💬

Comment on post by PostID

res, err := client.CommentPost(postID, comment)

Join Community 👨‍👨‍👧‍👧

Join community by CommunityID

res, err := client.JoinCommunity(communityID)

Sample

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
	}
}