Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhashkevych/go-pocket-sdk
Unofficial getpocket.com API Golang SDK
https://github.com/zhashkevych/go-pocket-sdk
api api-client getpocket go go-api go-api-client golang golang-library golang-package golang-sdk pocket sdk
Last synced: 7 days ago
JSON representation
Unofficial getpocket.com API Golang SDK
- Host: GitHub
- URL: https://github.com/zhashkevych/go-pocket-sdk
- Owner: zhashkevych
- Created: 2020-12-21T13:26:46.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-24T20:47:13.000Z (over 2 years ago)
- Last Synced: 2024-10-28T12:25:58.728Z (18 days ago)
- Topics: api, api-client, getpocket, go, go-api, go-api-client, golang, golang-library, golang-package, golang-sdk, pocket, sdk
- Language: Go
- Homepage: https://getpocket.com/developer/
- Size: 6.84 KB
- Stars: 24
- Watchers: 3
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GetPocket API Golang SDK
## https://getpocket.com/developer/### Example usage:
```go
package mainimport (
"context"
"fmt"
pocket "github.com/zhashkevych/go-pocket-sdk"
"log"
)func main() {
ctx := context.Background()client := pocket.NewClient("") // 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)
}
}
```