mmscrappers

package
v0.0.0-...-4a0a234 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDateFormat string = "2006-01-02"
View Source
var DefaultDatetimeFormat string = "2006-01-02 15:04:05"

Functions

func GetPage

func GetPage(url string, headers map[string][]string) (io.Reader, error)

func PrintArticle

func PrintArticle(a Article)

func SaveTodaysArticlesToDB

func SaveTodaysArticlesToDB(db *gorm.DB)

Types

type Article

type Article struct {
	Title         string
	Url           string
	Author        string
	Text          string
	Date          time.Time
	MassMediaName string
	ImgUrl        string
}

type ArticleListItem

type ArticleListItem struct {
	Title    string
	Url      string
	ImageUrl string
	Date     time.Time
}

type GetByPage

type GetByPage interface {
	ArticleListByPage(pageNum int16) []Article
}

type GetByTime

type GetByTime interface {
	ArticleListByDate(time.Time) []Article
}

type Kaktus

type Kaktus struct {
	Headers map[string][]string
	// contains filtered or unexported fields
}

func NewKaktus

func NewKaktus() Kaktus

func (Kaktus) ArticleListByTime

func (k Kaktus) ArticleListByTime(t time.Time) ([]Article, error)

func (Kaktus) ArticleListToday

func (k Kaktus) ArticleListToday() ([]Article, error)

type MMscrapper

type MMscrapper interface {
	ArticleListToday() ([]Article, error)
}

func GetAllScrappers

func GetAllScrappers() []MMscrapper

type News24

type News24 struct {
	Headers map[string][]string
	// contains filtered or unexported fields
}

func NewNews24

func NewNews24() News24

func (News24) ArticleListByPage

func (n News24) ArticleListByPage(pageNum int16)

func (News24) ArticleListToday

func (n News24) ArticleListToday() ([]Article, error)

func (News24) GetURL

func (n News24) GetURL() string

Jump to

Keyboard shortcuts

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