Skip to content

avldya/go-ynote

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-ynote GoSearch

go-ynote 是有道云笔记开放平台 API 的 Go SDK。

GoDoc 文档

使用了 go-ynote 的 项目列表

用法

  1. 建立一个*YnoteClient对象,设置开发者 token/secret.
yc := ynote.NewOnlineYnoteClient(ynote.Credentials{
    Token:  "****",
    Secret: "****"})
  1. 如果还没获得AccToken(存取令牌),如下方式得到:
tmpCred, err := yc.RequestTemporaryCredentials()
if err != nil {
	return
}
fmt.Println("Temporary credentials got:", tmpCred)

authUrl := yc.AuthorizationURL(tmpCred)
// Let the end-user access this URL of authUrl using a browser,
// authorize the request, and get a verifier.

verifier := ... // Ask the end-user for the verifier

accToken, err := yc.RequestToken(tmpCred, verifier)
if err != nil {
	return
}

// save the accToken for further using.
  1. 之后只要把保存下来的AccToken设置到ycAccToken域就可以了(RequestToken如果成功会自动设置AccToken域)
yc.AccToken = readAccToken()
  1. 使用yc的操作方法,如 UserInfo/ListNotebooks

DEMO

demo 程序 是一个云笔记的控制台程序,演示了所有 API 的用法。实际使用时,请替换着里面的 token。

LICENSE

BSD license.

About

The open-api library for youdao note (有道云笔记).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%