MCPcopy Create free account
hub / github.com/FloatTech/AnimeAPI / Rank

Method Rank

pixiv/pixiv.go:105–117  ·  view source on GitHub ↗

Rank 画作排行榜

()

Source from the content-addressed store, hash-verified

103
104// Rank 画作排行榜
105func (value RankValue) Rank() (r [18]int, err error) {
106 if value.Mode == "male_r18" || value.Mode == "male" || value.Mode == "female_r18" || value.Mode == "female" {
107 value.Type = "all"
108 }
109 body, err := get(fmt.Sprintf("https://www.pixiv.net/touch/ajax/ranking/illust?mode=%s&type=%s&page=%d&date=%s", value.Mode, value.Type, value.Page, value.Date))
110 i := 0
111 gjson.Get(binary.BytesToString(body), "body.ranking").ForEach(func(key, value gjson.Result) bool {
112 r[i] = int(value.Get("illustId").Int())
113 i++
114 return i != 18
115 })
116 return
117}
118
119// get 返回请求数据
120func get(link string) ([]byte, error) {

Callers

nothing calls this directly

Calls 1

getFunction · 0.85

Tested by

no test coverage detected