tagesschau

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SMALL ImageSize = iota
	MEDIUM
	LARGE

	SQUARE AspectRation = iota
	RECT
)

Variables

View Source
var ENGLISH_NAMES = map[RegionID]RegionName{
	DE: "Germany",
	BW: "Baden-Württemberg",
	BY: "Bavaria",
	BE: "Berlin",
	BB: "Brandenburg",
	HB: "Bremen",
	HH: "Hamburg",
	HE: "Hessen",
	MV: "Mecklenburg-Western Pomerania",
	NI: "Lower Saxony",
	NW: "North Rhine-Westphalia",
	RP: "Rhineland-Palatinate",
	SL: "Saarland",
	SN: "Saxony",
	ST: "Saxony-Anhalt",
	SH: "Schleswig-Holstein",
	TH: "Thuringia",
}
View Source
var GERMAN_NAMES = map[RegionID]RegionName{
	DE: "Deutschland",
	BW: "Baden-Württemberg",
	BY: "Bayern",
	BE: "Berlin",
	BB: "Brandenburg",
	HB: "Bremen",
	HH: "Hamburg",
	HE: "Hessen",
	MV: "Mecklenburg-Vorpommern",
	NI: "Niedersachsen",
	NW: "Nordrhein-Westfalen",
	RP: "Rheinland-Pfalz",
	SL: "Saarland",
	SN: "Sachsen",
	ST: "Sachsen-Anhalt",
	SH: "Schleswig-Holstein",
	TH: "Thüringen",
}

Functions

func ContentToParagraphs added in v0.0.7

func ContentToParagraphs(content []Content) []string

func GetShortNewsURL

func GetShortNewsURL() (string, error)

func RegionIdToName added in v0.1.3

func RegionIdToName(id int) (string, error)

Types

type Article added in v0.1.3

type Article struct {
	Topline      string     `json:"topline"`
	Desc         string     `json:"title"`
	Introduction string     `json:"firstSentence"`
	Tags         []Tag      `json:"tags"`
	Type         string     `json:"type"`
	Ressort      string     `json:"ressort"`
	RegionID     RegionID   `json:"regionId"`
	RegionIDs    []RegionID `json:"regionIds"`
	URL          string     `json:"shareURL"`
	Breaking     bool       `json:"breakingNews"`
	Date         time.Time  `json:"date"`
	ImageData    ImageData  `json:"teaserImage"`
	Content      []Content  `json:"content"`
	Video        Video      `json:"video"`
	ID           string     `json:"sophoraId"`
	Thumbnail    image.Image
}

func (Article) Description added in v0.1.3

func (n Article) Description() string

func (Article) FilterValue added in v0.1.3

func (n Article) FilterValue() string

func (Article) Title added in v0.1.3

func (n Article) Title() string

type AspectRation added in v0.1.3

type AspectRation int

type Content

type Content struct {
	Value string `json:"value"`
	Type  string `json:"type"`
}

type ImageData added in v0.1.3

type ImageData struct {
	Title         string        `json:"alttext"`
	Type          string        `json:"type"`
	ImageVariants ImageVariants `json:"imageVariants"`
}

type ImageSize added in v0.1.3

type ImageSize int

type ImageSpec added in v0.1.3

type ImageSpec struct {
	Size  ImageSize
	Ratio AspectRation
}

type ImageVariants added in v0.1.3

type ImageVariants struct {
	SquareSmall  string `json:"1x1-144"`
	SquareMedium string `json:"1x1-432"`
	SquareLarge  string `json:"1x1-840"`
	RectSmall    string `json:"16x9-256"`
	RectMedium   string `json:"16x9-640"`
	RectLarge    string `json:"16x9-1920"`
}

type News

type News struct {
	NationalNews []Article `json:"news"`
	RegionalNews []Article `json:"regional"`
}

func LoadNews

func LoadNews() News

func (*News) EnrichWithThumbnails added in v0.1.3

func (news *News) EnrichWithThumbnails(imageSpec ImageSpec)

func (*News) GetArticlesOfRegion added in v0.1.3

func (news *News) GetArticlesOfRegion(regionId RegionID) []Article

type RegionID added in v0.1.3

type RegionID int
const (
	DE RegionID = iota
	BW
	BY
	BE
	BB
	HB
	HH
	HE
	MV
	NI
	NW
	RP
	SL
	SN
	ST
	SH
	TH
)

type RegionName added in v0.1.3

type RegionName string

type Tag added in v0.1.3

type Tag struct {
	Tag string `json:"tag"`
}

type Video

type Video struct {
	Title         string        `json:"title"`
	Date          time.Time     `json:"date"`
	VideoVariants VideoVariants `json:"streams"`
}

type VideoVariants added in v0.1.3

type VideoVariants struct {
	Small  string `json:"h264s"`
	Medium string `json:"h264m"`
	Big    string `json:"h264xl"`
}

Jump to

Keyboard shortcuts

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