/graw

Golang Reddit API Wrapper

Primary LanguageGoMIT LicenseMIT

graw

Status: Pilot Program

Build Status Coverage Status GoDoc

go get github.com/turnage/graw

graw is for writing Reddit bots

  • that run forever and all the time.
  • quickly without worrying about things like "loops".
  • in Go!

Choose what events on Reddit to listen for (e.g. private messages, or new posts in certain subreddits) and graw will feed them to your bot. Here is a simple graw bot that announces new posts:

type AnnouncerBot struct {}

func (a *AnnouncerBot) Post(post *redditproto.Link) {
    fmt.Printf("New post by %s: %s\n", post.GetAuthor(), post.GetTitle())
}

graw provides all data from Reddit in the form of Protocol Buffers. See graw's proto definitions.

See the wiki for a quick start.