package main
import (
"context"
"fmt"
pocket "github.com/zhashkevych/go-pocket-sdk"
"log"
)
func main() {
ctx := context.Background()
client := pocket.NewClient("<your-consumer-key>") // you can generate key at https://getpocket.com/developer/apps/
requestToken, err := client.GetRequestToken(ctx, "http://example.com/")
if err != nil {
log.Fatalf("failed to get request token: %s", err.Error())
}
url := client.GetAuthorizationURL(requestToken, "http://example.com/")
fmt.Println(url)
authResp, err := client.Authorize(ctx, requestToken)
if err != nil {
log.Fatalf("failed to authorize: %s", err)
}
err = client.Add(ctx, pocket.AddInput{
URL: "https://github.com/zhashkevych/go-pocket-sdk",
AccessToken: authResp.AccessToken,
})
if err != nil {
log.Fatalf("failed to add item: %s", err)
}
}
forked from zhashkevych/go-pocket-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Unofficial getpocket.com API Golang SDK
tmstn/go-pocket-sdk
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Unofficial getpocket.com API Golang SDK
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Go 100.0%