drudge

package module
v0.0.0-...-12b20f2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: MIT Imports: 9 Imported by: 0

README

drudge

GoDoc Go Report Card Build Status

drudge provides a variety of tools for accessing and dealing with data from Drudge Report. It is currently under heavy development and missing many planned features. Feel free to submit pull requests if there's something missing that you're interested in.

Documentation

Index

Constants

View Source
const (
	// URL is the URL from which all information is fetched.
	URL = "http://www.drudgereport.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	// Headline is the text used for the link to the article on Drudge
	// Report. It is likely not the article's actual headline.
	Headline string

	// URL is the URL of the article as linked to by Drudge Report.
	URL *url.URL

	// Image is the image associated with the article, if there is one.
	Image *url.URL
}

Article holds information about an article.

type Client

type Client struct {
	// Client is the http.Client to use for fetching data.
	Client http.Client
	// contains filtered or unexported fields
}

Client is used for getting data from Drudge Report. It is safe for concurrent use. The zero value of client is ready to use.

A Client caches the parsed HTML data that is fetched from Drudge Report. This cache is refreshed if at least an hour has passed since the last update to the cache.

func (*Client) Column

func (c *Client) Column(num Column) ([]Article, error)

Column returns the articles in one of the columns.

func (*Client) Top

func (c *Client) Top() (articles []Article, err error)

Top returns the articles in the top section of the page. This includes the main headline.

type Column

type Column int

A Column cooresponds to one of the columns of the site, numbered from the left.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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