An Inoreader API client for Go
- Go 100%
|
|
||
|---|---|---|
| .vscode | Initial commit | |
| config | Improve comments | |
| stream | Improve comments | |
| subscription | Improve comments | |
| tags | Improve comments | |
| userinfo | Improve comments | |
| .gitignore | Initial commit | |
| doc.go | Implement testing | |
| go.mod | Remodel to an actual API client | |
| LICENSE | Initial commit | |
| README.md | Update README.md | |
go-inoreader
WORK IN PROGRESS 🚧: An unofficial Inoreader API client
We need to create a new application on Inoreader under Preferences > Developer. Set the redirect URI to http://localhost:8081/oauth/redirect and scope to Read and write. We will then get an App ID and App Key. Save the App ID and App Key aa JSON items to the configuration file. On Unix/Linux: ~/.local/share/go-inoreader.json. On Windows: $env:APPDATA\go-inoreader.json.
{
"app_id": <your app id>,
"app_key": <your app key>
}
Install using Go's builtin package manager:
go get -v github.com/hyperreal64/go-inoreader
Usage
We need to authorize with the Inoreader API first:
packagemainimport"github.com/hyperreal64/go-inoreader/config"funcmain(){config.Init()}Now run go run main.go to initiate the OAuth flow.
Example: Subscription list
packagemainimport("context""fmt""log""github.com/hyperreal64/go-inoreader/config""github.com/hyperreal64/go-inoreader/subscription")funcmain(){ctx,cancel:=context.WithCancel(context.Background())rc:=config.Oauth2RestyClient(ctx)defercancel()sublist,err:=subscription.GetSubscriptionList(rc)iferr!=nil{log.Fatalln(err)}for_,v:=rangesublist.Subscriptions{fmt.Printf("%s (%s)\n",v.Title,v.URL)}}Output would be something like this:
OSNews (http://www.osnews.com/files/recent.xml)
Planet Python (http://planet.python.org/rss10.xml)
Opensource.com (https://opensource.com/feed)
The GoLang Blog (https://blog.golang.org/feed.atom)
Going Go Programming (https://www.goinggo.net/index.xml)
Go Time (https://changelog.com/gotime/feed)
The Changelog (https://changelog.com/podcast/feed)
Command Line Heroes (https://feeds.pacific-content.com/commandlineheroes)
freeCodeCamp.org News (https://www.freecodecamp.org/news/rss/)
Enable Sysadmin (https://www.redhat.com/sysadmin/rss.xml)
Blogs on Drew DeVault's blog (https://drewdevault.com/blog/index.xml)