sources

package
v0.0.0-...-20a9ef9 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YnetURL      = "https://alerts.ynet.co.il/alertsRss/YnetPicodeHaorefAlertFiles.js?callback=jsonCallback"
	YnetReferrer = "https://www.ynet.co.il/"
	OrefURL      = "https://www.oref.org.il/WarningMessages/alert/alerts.json"
	OrefReferrer = "https://www.oref.org.il//12481-he/Pakar.aspx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertSource

type AlertSource interface {
	Register()
	Fetch() []byte
	Parse(content []byte) []*bot.Message
	Run()
}

type OrefMessage

type OrefMessage struct {
	ID           string   `json:"id"`
	CategoryInt  string   `json:"cat"`
	CategoryStr  string   `json:"title"`
	Cities       []string `json:"data"`
	Instructions string   `json:"desc"`
}

type SourceOref

type SourceOref struct {
	Bot *bot.Bot
	// contains filtered or unexported fields
}

func (*SourceOref) Fetch

func (s *SourceOref) Fetch() []byte

func (*SourceOref) Parse

func (s *SourceOref) Parse(content []byte) []*bot.Message

func (*SourceOref) Register

func (s *SourceOref) Register()

func (*SourceOref) Run

func (s *SourceOref) Run()

type SourceTelegram

type SourceTelegram struct {
	Bot *bot.Bot
	// contains filtered or unexported fields
}

func (*SourceTelegram) Fetch

func (s *SourceTelegram) Fetch() []byte

func (*SourceTelegram) Parse

func (s *SourceTelegram) Parse(content []byte) []bot.Message

func (*SourceTelegram) ParseMessage

func (s *SourceTelegram) ParseMessage(ctx context.Context, e tg.Entities, update *tg.UpdateNewChannelMessage) error

func (*SourceTelegram) Register

func (s *SourceTelegram) Register()

func (*SourceTelegram) Run

func (s *SourceTelegram) Run()

type SourceYnet

type SourceYnet struct {
	URL string

	Bot *bot.Bot
	// contains filtered or unexported fields
}

func (*SourceYnet) Fetch

func (s *SourceYnet) Fetch() []byte

func (*SourceYnet) Parse

func (s *SourceYnet) Parse(content []byte) []*bot.Message

func (*SourceYnet) Register

func (s *SourceYnet) Register()

func (*SourceYnet) Run

func (s *SourceYnet) Run()

type StorageMattermost

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

func (*StorageMattermost) LoadSession

func (s *StorageMattermost) LoadSession(ctx context.Context) ([]byte, error)

LoadSession loads session from memory.

func (*StorageMattermost) StoreSession

func (s *StorageMattermost) StoreSession(ctx context.Context, data []byte) error

StoreSession stores session to memory.

type YnetMessage

type YnetMessage struct {
	Alerts YnetMessageItems `json:"alerts"`
}

type YnetMessageItem

type YnetMessageItem struct {
	Item YnetMessageItemConcrete `json:"item"`
}

type YnetMessageItemConcrete

type YnetMessageItemConcrete struct {
	Guid        string `json:"guid"`
	Time        string `json:"pubdate"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Link        string `json:"link"`
}

type YnetMessageItems

type YnetMessageItems struct {
	Items []YnetMessageItem `json:"items"`
}

Jump to

Keyboard shortcuts

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