redditnews

package module
v0.0.0-...-116a273 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2014 License: MIT Imports: 6 Imported by: 0

README

An Internal Project: redditnews

baby-gopher These projects specifications were given to a "Baby Gopher".

"I am keen to be abreast with what's happening in the Golang world. To that end, we will write a command-line program (redditnews.go) that fetches and displays the latest headlines from the golang page on Reddit.

The program will:

  • make an HTTP request to the Reddit API.
  • decode the JSON response into a Go data structure, and
  • display each link's author, score, URL and title.

We will then be building a bare-bones News Reader package (redditnews) that gives us the latest news and headlines from the Golang Sub-Reddit, using Reddit's API.

The "Baby Gopher" built this package and documented his progress so that other "Baby Gophers" could find it easy to understand the mechanics of writing a package in Go. He/she would now be able to build their own Go packages.

Documentation

Overview

redditnews package implements a basic client for the Reddit API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Email

func Email() string

Email prepares the body of an email

Types

type Item

type Item struct {
	Author string `json:"author"`
	Score  int    `json:"score"`
	URL    string `json:"url"`
	Title  string `json:"title"`
}

Item describes a RedditNews item.

func Get

func Get(reddit string) ([]Item, error)

Get fetches the most recent Items posted to the specified subreddit.

func (Item) String

func (i Item) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL