Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
github.com/gabstv/geddit
a convenient abstraction for the reddit.com API in Go
Checkout the godoc page
this is a work in progress!
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",
"gedditAgent v1",
)
// Set listing options
subOpts := geddit.ListingOptions{
Limit: 10,
}
// Get reddit's default frontpage
submissions, _ := session.DefaultFrontpage(geddit.DefaultPopularity, subOpts)
// Get our own personal frontpage
submissions, _ = session.Frontpage(geddit.DefaultPopularity, subOpts)
// Get specific subreddit submissions, sorted by new
submissions, _ = session.SubredditSubmissions("hockey", geddit.NewSubmissions, subOpts)
// 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)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.