nyxwulf / geddit

golang reddit api wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geddit

a convenient abstraction for the reddit.com API in Go

Checkout the godoc page

warning

this is a work in progress!

example

package main

import (
	"fmt"

	"github.com/jzelinskie/geddit"
)

// Please don't handle errors this way.
func main() {
	// Login to reddit
	session, _ := geddit.NewLoginSession(
		"novelty_account",
		"password",
		"golang reddit example",
	)

	// Get reddit's default frontpage
	submissions, _ := session.DefaultFrontpage()

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

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

About

golang reddit api wrapper

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%