appdater

package module
v0.0.0-...-e00e507 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

Appdater

AppStore update checker in Go

  • App Store
  • Google Play
  • Kindle Store

Feature

  • Single executable binary (Embedded config file using statik)
  • Multiple application register
  • Slack notification

Config

See appdater/config.toml.sample

Run

# make assets/config.toml
$ statik -src assets
$ go run cmd/appdater/main.go

Make executable binary

# make assets/config.toml
$ statik -src assets
$ go build -o appdater cmd/appdater/main.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UA_LIST = []string{
	"Mozilla/5.0 (Macintosh; Intel Mac OS X)",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36",
	"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0",
	"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090716 Linux Mint/7 (Gloria) Firefox/3.5.1",
	"Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.10) Gecko/2009042708 Fedora/3.0.10-1.fc10 Firefox/3.0.10",
	"Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.0.11) Gecko/2009070611 Gentoo Firefox/3.0.11",
	"Mozilla/5.0 (X11; Arch Linux; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3864.0 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:67.0) Gecko/20100101 Firefox/67.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Firefox/68.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15",
}

Functions

func CreateErrorPayload

func CreateErrorPayload(message string, emoji string) slack.Payload

func CreatePayload

func CreatePayload(name string, version string, website string, emoji string) slack.Payload

func ScrapeLatestVersion

func ScrapeLatestVersion(app App) (string, error)

func Validate

func Validate(version string) error

Types

type Android

type Android struct {
	Name        string `toml:"name"`
	Package     string `toml:"package"`
	WebhookUrl  string `toml:"webhook_url"`
	Emoji       string `toml:"emoji"`
	LastVersion string
}

func (Android) CleansingDomValue

func (a Android) CleansingDomValue(value string) string

func (Android) CreateAppPageUrl

func (a Android) CreateAppPageUrl() string

func (Android) GetQuery

func (a Android) GetQuery() string

type App

type App interface {
	CreateAppPageUrl() string
	GetQuery() string
	CleansingDomValue(value string) string
}

type CLI

type CLI struct {
	OutStream, ErrStream io.Writer
}

func (*CLI) Run

func (c *CLI) Run(args []string) int

type Config

type Config struct {
	Ios       []Ios     `toml:"ios"`
	Android   []Android `toml:"android"`
	Kindle    []Kindle  `toml:"kindle"`
	SleepTime int       `toml:"sleeptime"`
}

type Ios

type Ios struct {
	Name        string `toml:"name"`
	Country     string `toml:"country"`
	AppID       string `toml:"app_id"`
	WebhookUrl  string `toml:"webhook_url"`
	Emoji       string `toml:"emoji"`
	LastVersion string
}

func (Ios) CleansingDomValue

func (i Ios) CleansingDomValue(value string) string

func (Ios) CreateAppPageUrl

func (i Ios) CreateAppPageUrl() string

func (Ios) GetQuery

func (i Ios) GetQuery() string

type Kindle

type Kindle struct {
	Name        string `toml:"name"`
	Asin        string `toml:"asin"`
	WebhookUrl  string `toml:"webhook_url"`
	Emoji       string `toml:"emoji"`
	LastVersion string
}

func (Kindle) CleansingDomValue

func (k Kindle) CleansingDomValue(value string) string

func (Kindle) CreateAppPageUrl

func (k Kindle) CreateAppPageUrl() string

func (Kindle) GetQuery

func (k Kindle) GetQuery() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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