command

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenTweets

func ListenTweets(tags ...string)

ListenTweets listens to twitch through developer api

Types

type Duck

type Duck struct {
	Data struct {
		Abstract         string `json:"Abstract"`
		AbstractSource   string `json:"AbstractSource"`
		AbstractText     string `json:"AbstractText"`
		AbstractURL      string `json:"AbstractURL"`
		Answer           string `json:"Answer"`
		AnswerType       string `json:"AnswerType"`
		Definition       string `json:"Definition"`
		DefinitionSource string `json:"DefinitionSource"`
		DefinitionURL    string `json:"DefinitionURL"`
		Entity           string `json:"Entity"`
		Heading          string `json:"Heading"`
		Image            string `json:"Image"`
		Redirect         string `json:"Redirect"`
		RelatedTopics    []struct {
			FirstURL string `json:"FirstURL,omitempty"`
			Result   string `json:"Result,omitempty"`
			Text     string `json:"Text,omitempty"`
			Name     string `json:"Name,omitempty"`
			Topics   []struct {
				FirstURL string `json:"FirstURL"`
				Result   string `json:"Result"`
				Text     string `json:"Text"`
			} `json:"Topics,omitempty"`
		} `json:"RelatedTopics"`
		Results []interface{} `json:"Results"`
		Type    string        `json:"Type"`
		Meta    struct {
			Attribution  interface{} `json:"attribution"`
			Blockgroup   interface{} `json:"blockgroup"`
			CreatedDate  interface{} `json:"created_date"`
			Description  string      `json:"description"`
			Designer     interface{} `json:"designer"`
			DevDate      interface{} `json:"dev_date"`
			DevMilestone string      `json:"dev_milestone"`
			Developer    []struct {
				Name string `json:"name"`
				Type string `json:"type"`
				URL  string `json:"url"`
			} `json:"developer"`
			ExampleQuery    string      `json:"example_query"`
			ID              string      `json:"id"`
			IsStackexchange interface{} `json:"is_stackexchange"`
			JsCallbackName  string      `json:"js_callback_name"`
			LiveDate        interface{} `json:"live_date"`
			Maintainer      struct {
				Github string `json:"github"`
			} `json:"maintainer"`
			Name            string      `json:"name"`
			PerlModule      string      `json:"perl_module"`
			Producer        interface{} `json:"producer"`
			ProductionState string      `json:"production_state"`
			Repo            string      `json:"repo"`
			SignalFrom      string      `json:"signal_from"`
			SrcDomain       string      `json:"src_domain"`
			SrcID           int         `json:"src_id"`
			SrcName         string      `json:"src_name"`
			SrcOptions      struct {
				Directory         string `json:"directory"`
				IsFanon           int    `json:"is_fanon"`
				IsMediawiki       int    `json:"is_mediawiki"`
				IsWikipedia       int    `json:"is_wikipedia"`
				Language          string `json:"language"`
				MinAbstractLength string `json:"min_abstract_length"`
				SkipAbstract      int    `json:"skip_abstract"`
				SkipAbstractParen int    `json:"skip_abstract_paren"`
				SkipEnd           string `json:"skip_end"`
				SkipIcon          int    `json:"skip_icon"`
				SkipImageName     int    `json:"skip_image_name"`
				SkipQr            string `json:"skip_qr"`
				SourceSkip        string `json:"source_skip"`
				SrcInfo           string `json:"src_info"`
			} `json:"src_options"`
			SrcURL interface{} `json:"src_url"`
			Status string      `json:"status"`
			Tab    string      `json:"tab"`
			Topic  []string    `json:"topic"`
			Unsafe int         `json:"unsafe"`
		} `json:"meta"`
	} `json:"data"`
	DuckbarTopic string `json:"duckbar_topic"`
	Meta         struct {
		Attribution  interface{} `json:"attribution"`
		Blockgroup   interface{} `json:"blockgroup"`
		CreatedDate  interface{} `json:"created_date"`
		Description  string      `json:"description"`
		Designer     interface{} `json:"designer"`
		DevDate      interface{} `json:"dev_date"`
		DevMilestone string      `json:"dev_milestone"`
		Developer    []struct {
			Name string `json:"name"`
			Type string `json:"type"`
			URL  string `json:"url"`
		} `json:"developer"`
		ExampleQuery    string      `json:"example_query"`
		ID              string      `json:"id"`
		IsStackexchange interface{} `json:"is_stackexchange"`
		JsCallbackName  string      `json:"js_callback_name"`
		LiveDate        interface{} `json:"live_date"`
		Maintainer      struct {
			Github string `json:"github"`
		} `json:"maintainer"`
		Name            string      `json:"name"`
		PerlModule      string      `json:"perl_module"`
		Producer        interface{} `json:"producer"`
		ProductionState string      `json:"production_state"`
		Repo            string      `json:"repo"`
		SignalFrom      string      `json:"signal_from"`
		SrcDomain       string      `json:"src_domain"`
		SrcID           int         `json:"src_id"`
		SrcName         string      `json:"src_name"`
		SrcOptions      struct {
			Directory         string `json:"directory"`
			IsFanon           int    `json:"is_fanon"`
			IsMediawiki       int    `json:"is_mediawiki"`
			IsWikipedia       int    `json:"is_wikipedia"`
			Language          string `json:"language"`
			MinAbstractLength string `json:"min_abstract_length"`
			SkipAbstract      int    `json:"skip_abstract"`
			SkipAbstractParen int    `json:"skip_abstract_paren"`
			SkipEnd           string `json:"skip_end"`
			SkipIcon          int    `json:"skip_icon"`
			SkipImageName     int    `json:"skip_image_name"`
			SkipQr            string `json:"skip_qr"`
			SourceSkip        string `json:"source_skip"`
			SrcInfo           string `json:"src_info"`
		} `json:"src_options"`
		SrcURL interface{} `json:"src_url"`
		Status string      `json:"status"`
		Tab    string      `json:"tab"`
		Topic  []string    `json:"topic"`
		Unsafe int         `json:"unsafe"`
	} `json:"meta"`
	Model     string `json:"model"`
	PixelID   string `json:"pixel_id"`
	Signal    string `json:"signal"`
	Templates struct {
		Item string `json:"item"`
	} `json:"templates"`
}

type HackerNew

type HackerNew struct {
	Updated time.Time
	Title   string
	Content string
	Link    string
	Summary 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 []HackerNew

type HackerNewsRec

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

HackerNewsRec as a struct to capture data from hackernews.com

type KDRecord

type KDRecord struct {
	Updated time.Time
	Title   string
	Content string
	Link    string
	Summary string
	Tags    string
}

KDRecord

func KDNuggets

func KDNuggets(d string, nrecords int) ([]KDRecord, error)

KDNuggets retrieves the records for some months

type Page

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

Page

type RedditTopic

type RedditTopic struct {
	Updated time.Time
	Title   string
	Content string
	Link    string
	Summary 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

type Wiki

type Wiki struct {
	Title   string   `goquery:"h1"`
	Content []string `goquery:"div.mw-parser-output p"`
	Summary string
	Link    string
}

Wiki as the result from wikipedia

func GetWiki

func GetWiki(query string) (Wiki, error)

GetWiki will search first in wiki, if not found, use gogoduck, then wiki again

Jump to

Keyboard shortcuts

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