news

package
v0.0.0-...-1c0f6f5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByPubDate

type ByPubDate []RSSItem

func (ByPubDate) Len

func (a ByPubDate) Len() int

func (ByPubDate) Less

func (a ByPubDate) Less(i, j int) bool

func (ByPubDate) Swap

func (a ByPubDate) Swap(i, j int)

type NewsDateParser

type NewsDateParser struct {
	// contains filtered or unexported fields
}

func NewNewsDateParser

func NewNewsDateParser() *NewsDateParser

func (*NewsDateParser) Parse

func (self *NewsDateParser) Parse(pubDate string) (time.Time, error)

type NewsItem

type NewsItem struct {
	// contains filtered or unexported fields
}

type NewsWidget

type NewsWidget struct {
	widgets.BaseWidget
	// contains filtered or unexported fields
}

func NewNewsWidget

func NewNewsWidget() *NewsWidget

func (*NewsWidget) ProcessEvent

func (self *NewsWidget) ProcessEvent(e *evt.Event)

func (*NewsWidget) Render

func (self *NewsWidget) Render()

type RSSAtom

type RSSAtom struct {
	//<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	XMLName xml.Name `xml:"rss"`
	//<channel>
	Channel []RSSChannel `xml:"channel"`
}

type RSSChannel

type RSSChannel struct {
	//<title>ТАСС</title>
	Title string `xml:"title"`
	//<description>ИНФОРМАЦИОННОЕ АГЕНТСТВО РОССИИ ТАСС</description>
	Description string `xml:"description"`
	//<language>ru-ru</language>
	Language string `xml:"language"`
	//<link><![CDATA[https://tass.ru]]></link>
	Link string `xml:"link"`
	//<copyright>ТАСС</copyright>
	Copyright string `xml:"copyright"`
	//<image>
	Image struct {
		//<url><![CDATA[https://tass.ru/i/rss/logo.png]]></url>
		URL string `xml:"url"`
		//<title>ТАСС</title>
		Title string `xml:"title"`
		//<link><![CDATA[https://tass.ru]]></link>
		Link string `xml:"link"`
	} `xml:"image"`
	//</image>
	//<atom:link href="https://tass.ru/rss/v2.xml" rel="self" type="application/rss+xml"></atom:link>
	//<item>
	//</item>
	Items []RSSItem `xml:"item"`
}

type RSSItem

type RSSItem struct {
	//<title>Фигуристы Мишина и Галлямов удовлетворены прокатом короткой программы на чемпионате России</title>
	Title string `xml:"title"`
	//<link><![CDATA[https://tass.ru/sport/13287229]]></link>
	Link string `xml:"link"`
	//<guid><![CDATA[https://tass.ru/sport/13287229]]></guid>
	Guid string `xml:"guid"`
	//<pubDate>Thu, 23 Dec 2021 20:37:15 +0300</pubDate>
	PubDate string `xml:"pubDate"`
	//<description>За свое выступление спортсмены получили 83,74 балла</description>
	Description string `xml:"description"`
	//<enclosure url="https://cdn3.tass.ru/fit/400x300_b2b00b17/tass/m2/uploads/i/20211223/6529409.jpg" type="image/jpeg" length="2815904"></enclosure>
	Enclosure struct {
		URL string
	} `xml:"enclosure"`

	//<category>Спорт</category>
	//<category>Фигурное катание</category>
	//<category>Чемпионат России по фигурному катанию</category>
	Category []string `xml:"category"`
}

Jump to

Keyboard shortcuts

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