hackernews

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MPL-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStories

func GetStories(storyType string) ([]int, error)

Types

type Settings

type Settings struct {
	*cfg.Common
	// contains filtered or unexported fields
}

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

type Story

type Story struct {
	By          string `json:"by"`
	Descendants int    `json:"descendants"`
	ID          int    `json:"id"`
	Kids        []int  `json:"kids"`
	Score       int    `json:"score"`
	Time        int    `json:"time"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	URL         string `json:"url"`
}

Story represents a story submission on HackerNews

func GetStory

func GetStory(id int) (Story, error)
func (story *Story) CommentLink() string

CommentLink return the link to the HackerNews story comments page

func (story *Story) Link() string

Link returns the link to a story. If the story has an external link, that is returned If the story has no external link, the HackerNews comments link is returned instead

type Widget

type Widget struct {
	view.ScrollableWidget
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(tviewApp *tview.Application, pages *tview.Pages, settings *Settings) *Widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

func (*Widget) Render added in v0.10.0

func (widget *Widget) Render()

Render sets up the widget data for redrawing to the screen

Jump to

Keyboard shortcuts

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