supnews

package
v0.0.0-...-d76cf42 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendToWebhook

func SendToWebhook(res ResponseData, c Config)

Types

type Config

type Config struct {
	Webhook   string `json:"webhook"`
	Hexcode   string `json:"hexcode"`
	Icon      string `json:"icon"`
	Groupname string `json:"groupName"`
}

type Monitor

type Monitor struct {
	LatestText string
	Proxies    proxymanager.ProxyManager
	Config     Config
}

func NewMonitor

func NewMonitor(proxyFile string, c Config) (*Monitor, error)

NewMonitor returns a new Monitor object. A path to a txt file containing proxies can be passed in, or an empty string instead. If a proxy file is specified, it initializes a proxymanager instance. Proxies can be accessed from Monitor.Proxies To access next / random proxy for example: Monitor.Proxies.NextProxy() / Monitor.Proxies.RandomProxy()

func (*Monitor) StartMonitor

func (m *Monitor) StartMonitor()

type Response

type Response http.Response

type ResponseData

type ResponseData struct {
	Title       string
	Description string
	Time        string
	Images      []string
}

func GetPage

func GetPage(proxy string) (ResponseData, error)

GetPage gets the latest news from https://supremenewyork.com/news. Can pass in an empty string for proxy if a proxy is not needed in the request. Returns struct ResponseData

Jump to

Keyboard shortcuts

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