news

package
v0.0.0-...-040a9cf Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dev

func Dev()

func PrettyPrint

func PrettyPrint(i interface{}) string

PrettyPrint to print struct in a readable way

func PrintResult

func PrintResult(news []HackerNew)

PrintResult is just some group by date formatting, decending order

Types

type HackerNew

type HackerNew struct {
	Title    string
	Date     string
	Link     string
	Abstract string
}

HackerNew as individual title

func GetHackerNews

func GetHackerNews(all bool) ([]HackerNew, error)

GetHackerNews gets the last two days news from hackernews

type HackerNews

type HackerNews struct {
	Title []string `goquery:"h2.home-title"`
	Date  []string `goquery:"div.item-label"`
	Link  []string `goquery:"a.story-link,[href]"`
}

HackerNews as a struct to capture data from hackernews.com

type Page

type Page struct {
	Content []string `goquery:"div.post-body p"`
}

Page

type RedditTopic

type RedditTopic struct {
	Title   string
	Content string
	Link    string
	Updated string
}

func Reddit

func Reddit(subreddit string) ([]RedditTopic, error)

Reddit reads the rss from the subreddit

type Trend

type Trend struct {
	Topic   string
	Title   string
	Traffic string
	URL     string
	Snippet string
}

func Gtrend

func Gtrend(country string) ([]Trend, error)

gtrend returns the google search keywords trend

Jump to

Keyboard shortcuts

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