Reddit API bindings for Go. The primary focus of this package is to be a tool for writing bots and not a full API implementation.
Browse the online reference documentation:
session := rego.NewSession("RegoBot/1.0")
page := session.Listing("r/worldnews/new")
page.SetLimit(5)
list, err := page.Next()
if err != nil {
log.Print(err)
}
for _, l := range list.Links() {
if l.Selfpost {
continue
}
fmt.Printf("Title: %30s, Url: %s\n", l.Title, l.Url)
}
- Unauthenticated sessions should use http by default to take advantage of Reddit caches
- Hitting Reddit caches are 'free' requests and do not count against rate limits
- This will be configurable for cases where TLS is desired