Skip to content

Commit

Permalink
update example subreddit usage in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aggrolite committed Apr 25, 2015
1 parent 9865114 commit 2aed6ac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Expand Up @@ -27,11 +27,20 @@ func main() {
"gedditAgent v1",
)

// Set listing options
subOpts := geddit.ListingOptions{
Limit: 10,
}

// Get reddit's default frontpage
submissions, _ := session.DefaultFrontpage()
// "" sort argument defaults to hot
submissions, _ := session.DefaultFrontpage("", subOpts)

// Get our own personal frontpage
submissions, _ = session.Frontpage()
submissions, _ = session.Frontpage("", subOpts)

// Get specific subreddit submissions, sorted by new
submissions, _ = session.SubredditSubmissions("hockey", "new", subOpts)

// Print title and author of each submission
for _, s := range submissions {
Expand Down

0 comments on commit 2aed6ac

Please sign in to comment.