Skip to content

SDK for Golang developers who want to connect Pocket to their services

Notifications You must be signed in to change notification settings

siteddv/golang-pocket-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GetPocket API Golang SDK

You can access full documentation by this link

Example usage:

package main

import (
	"context"
	pocket "github.com/siteddv/golang-pocket-sdk"
	"log"
)

func main() {
	ctx := context.Background()

	client, err := pocket.NewClient("<your-consumer-key>") // you can generate key at https://getpocket.com/developer/apps/
	if err != nil {
		log.Fatalf("failed to init client: %s", err.Error())
		return
	}

	requestToken, err := client.GetRequestToken(ctx, "https://example.com/")
	if err != nil {
		log.Fatalf("failed to get request token: %s", err.Error())
	}

	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/siteddv/golang-pocket-sdk",
		AccessToken: authResp.AccessToken,
	})

	if err != nil {
		log.Fatalf("failed to add item: %s", err)
	}
}

Have a nice experience with repository!

If you have any questions and suggestions, please contact me via email siteddv@gmail.com

About

SDK for Golang developers who want to connect Pocket to their services

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages