Skip to content

Commit

Permalink
Merge pull request jzelinskie#9 from aggrolite/README/example
Browse files Browse the repository at this point in the history
replace example UA string, expand example submissions usage
  • Loading branch information
jzelinskie committed Apr 24, 2015
2 parents 9eae5f7 + 08f6923 commit 9bedd91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ func main() {
session, _ := geddit.NewLoginSession(
"novelty_account",
"password",
"golang reddit example",
"gedditAgent v1",
)

// Get reddit's default frontpage
Expand All @@ -33,6 +33,11 @@ func main() {
// Get our own personal frontpage
submissions, _ = session.Frontpage()

// Print title and author of each submission
for _, s := range submissions {
fmt.Printf("Title: %s\nAuthor: %s\n\n", s.Title, s.Author)
}

// Upvote the first post
session.Vote(submissions[0], geddit.UpVote)
}
Expand Down

0 comments on commit 9bedd91

Please sign in to comment.