resource

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ls      = 1
	LSGroup = 2
)
View Source
const (
	MikanRssLiXpath = `/html/body[@class='main']/
		div[@id='sk-container']/
		div[@class='central-container']/
		ul[@class='list-inline an-ul']/li`

	BgmXpathExp = `` /* 141-byte string literal not displayed */

)

Variables

View Source
var ResourceAPIs = map[string]string{
	"search": "/Home/Search?searchstr=",
}

Functions

func BuildSearching

func BuildSearching(s string) string

func FetchBgmTVUrl

func FetchBgmTVUrl(page string) (url string, err error)

func InnerTextSafety

func InnerTextSafety(n *html.Node) string

InnerTextSafety avoid nil pointer panic

func ListScrape

func ListScrape(searchstr string, t LsTyp, searchls bool) (res any, err error)

func Scrape

func Scrape(searchstr string, opt Option) (url, bgmUrl string, isrss bool, err error)

Types

type Item

type Item struct {
	Name       string
	Size       string
	UpdateTime string
}

type LsTyp

type LsTyp int

func (LsTyp) String

func (t LsTyp) String() string

type Option

type Option struct {
	Index int
	Group string
}

type RssGroup

type RssGroup struct {
	Name  string
	Items []Item
}

Jump to

Keyboard shortcuts

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