Documentation ¶
Index ¶
- Constants
- Variables
- func CleanDescription(html string) string
- func CleanHTML(html string) string
- func GetFeedItems(client *http.Client, req *http.Request) ([]*gofeed.Item, error)
- func GetOriginalLink(sourceLink string) (string, error)
- func IsExcludedSource(url string, excludeWebsites *[]string) bool
- func IsGoogleNewsLink(link string) bool
Constants ¶
View Source
const (
MaxSearchResults = 100
)
Variables ¶
View Source
var ( USER_AGENTS = []string{}/* 184 elements not displayed */ RandomUserAgent = func() string { return USER_AGENTS[rand.Intn(len(USER_AGENTS))] } )
View Source
var ( GOOGLE_NEWS_REGEX = `^http(s)?://(www.)?news.google.com*` ErrEmptyQuery = fmt.Errorf("query cannot be empty") ErrEmptyTopic = fmt.Errorf("topic cannot be empty") ErrInvalidTopic = fmt.Errorf("invalid topic") ErrEmptyLocation = fmt.Errorf("location cannot be empty") ErrFailedToGetNewsContent = fmt.Errorf("failed to get news content") ErrEmptyLink = fmt.Errorf("link cannot be empty") )
Functions ¶
func CleanDescription ¶
func GetFeedItems ¶
get feed items
func GetOriginalLink ¶ added in v1.1.0
GetOriginalLink gets the original link
func IsExcludedSource ¶
IsExcludedSource checks if the item's link is from an excluded website
func IsGoogleNewsLink ¶ added in v1.1.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.