exsrapi

package module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 17 Imported by: 0

README

Documentation

Overview

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

!

Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

Ver.0.0.1 ConfigのFncを削除する。

Ver.0.1.0 ApiLiveCurrentUser()の引数roomidをstringとしたことへ対応する。ApiLiveCurrentUser()実行時のroomidにRoomid[0]を渡す。 Ver.1.0.0 下位の関数で戻り値をstatusかrerrに変更したことに対応する。

Index

Constants

This section is empty.

Variables

View Source
var Hdrspc = ""
View Source
var SortByFollowers bool

Functions

func CreateLogfile

func CreateLogfile(dsc ...string) (logfile *os.File, err error)

ログファイルを作る。

func CreateNewClient

func CreateNewClient(
	cookiename string,
) (
	client *http.Client,
	jar *cookiejar.Jar,
	err error,
)

HTTPクライアントを作り、cookiejarをセットする。

func FuncNameOfThisFunction added in v1.4.0

func FuncNameOfThisFunction() (
	funcname string,
)

func GetEventidOfEventBox added in v1.4.0

func GetEventidOfEventBox(
	eventid string,
) (
	namelist []string,
	err error,
)

func GetEventinf added in v1.4.0

func GetEventinf(
	eventid string,
	eventinfo *Event_Inf,
) (
	err error,
)

func GetEventinfAndRoomList added in v1.4.0

func GetEventinfAndRoomList(
	eventid string,
	breg int,
	ereg int,
	eventinfo *Event_Inf,
	roominfolist *RoomInfoList,
) (
	status int,
)

func GetEventinfAndRoomListBR added in v1.4.0

func GetEventinfAndRoomListBR(
	client *http.Client,
	eventid string,
	breg int,
	ereg int,
	eventinfo *Event_Inf,
	roominfolist *RoomInfoList,
) (
	status int,
)

func GetRoominfFromEventOfBR added in v1.5.0

func GetRoominfFromEventOfBR(
	client *http.Client,
	eventid string,
	breg int,
	ereg int,
) (
	roomlistinf *srapi.RoomListInf,
	err error,
)

func LoadConfig

func LoadConfig(filePath string, config interface{}) (err error)

設定ファイルを読み込む

以下の記事を参考にさせていただきました。
	【Go初学】設定ファイル、環境変数から設定情報を取得する
		https://note.com/artefactnote/n/n8c22d1ac4b86

func LoginShowroom

func LoginShowroom(
	client *http.Client,
	acct string,
	pswd string,
) (
	userid string,
	err error,
)

Showroomのサービスにログインし、ユーザIDを取得する。

func MakePeriod added in v1.5.0

func MakePeriod(
	started_at int64,
	ended_at int64,
) (
	period string,
	err error,
)

func MkRoomsForStarCollec

func MkRoomsForStarCollec(
	client *http.Client,
	category string,
	aplmin int,
	maxnoroom int,
	excllist *ExclList,
	roomvisit *map[int]time.Time,
) (
	lives *[]srapi.Live,
	err error,
)

星集め、種集めの対象とするルームの一覧を作成する。

func PrintExf added in v1.4.0

func PrintExf(comment ...string) func()

func PrtHdr added in v1.4.0

func PrtHdr() (
	fncname string,
)

func TestOfApiActivefanNextlevel

func TestOfApiActivefanNextlevel(filename string) (err error)

ファンレベルの達成状況を取得する

使用しているSHOWROOMのAPI
	srapi.ApiLiveCurrentUser()
	srapi.CsrfToken()
	srapi.UserLogin()
	srapi.ApiActivefanNextlevel()

Types

type Block added in v1.4.0

type Block struct {
	Label    string
	Block_id int
}

type BlockInf added in v1.4.0

type BlockInf struct {
	Show_rank_label string
	Block_list      []Block
}

type BlockInfList added in v1.5.0

type BlockInfList struct {
	Blockinf []BlockInf
}

func GetEventidOfBlockEvent added in v1.4.0

func GetEventidOfBlockEvent(
	eventid string,
) (
	blockinflist BlockInfList,

	err error,
)

ブロックイベントの子のイベントのeventidを取得する。

type Event_Inf added in v1.4.0

type Event_Inf struct {
	Event_ID    string
	I_Event_ID  int
	Event_name  string
	Period      string
	Dperiod     float64
	Start_time  time.Time
	Sstart_time string
	Start_date  float64
	End_time    time.Time
	Send_time   string
	NoEntry     int
	NoRoom      int //      ルーム数
	Intervalmin int
	Modmin      int
	Modsec      int
	Fromorder   int
	Toorder     int
	Resethh     int
	Resetmm     int
	Nobasis     int
	Maxdsp      int
	Cmap        int
	Target      int
	Rstatus     string
	Maxpoint    int //      グラフのy軸のスケールを固定する
	MaxPoint    int //      DBには該当するものはない(データ中最大のポイント値を意味し、内部的に使用する)
	Gscale      int //      DBのMaxpoint = 構造体の Maxpoint + Gscale
	Achk        int //      1: ブロック、2:ボックス、子ルーム未処理のあいだはそれぞれ +4
	Aclr        int //未使用

	EventStatus string //   "Over", "BeingHeld", "NotHeldYet"
	Pntbasis    int
	Ordbasis    int
	League_ids  string
	Valid       bool //	データとして有効か?(内部処理で処理の分岐に使う)

}

func ConvertEventToEventinf added in v1.4.0

func ConvertEventToEventinf(
	event *srapi.Event,
) (
	Eventinf *Event_Inf,
)

ApiEventSearch()で得られるイベント情報構造体 srapi.Eventを データベースのeventテーブルに対応したexsrapi.Event_Infに変換する

type ExclList

type ExclList map[int]string //	除外ルームIDリスト

除外リスト

func (ExclList) Read

func (el ExclList) Read(
	category string,
	exclfilename string,
) (
	err error,
)

除外リストの読み込み

type RoomAfnl

type RoomAfnl struct {
	Room_id   string //	配信者のID
	Main_name string //	配信者の名前
	Afnl      srapi.ActiveFanNextLevel
}

配信者のリストから、ファンレベルの達成状況を調べる。

func GetActiveFanNextLevel

func GetActiveFanNextLevel(
	client *http.Client,
	userid string,
	rooms []srapi.RoomFollowed,
) (
	roomafnls []RoomAfnl,
	err error,
)

type RoomInfo added in v1.4.0

type RoomInfo struct {
	Name      string //     ルーム名のリスト
	Longname  string
	Shortname string
	Account   string //     アカウントのリスト、アカウントは配信のURLの最後の部分の英数字です。
	ID        string //     IDのリスト、IDはプロフィールのURLの最後の部分で5~6桁の数字です。
	Userno    int
	//      APIで取得できるデータ(1)
	Genre      string
	Rank       string
	Irank      int
	Nrank      string
	Prank      string
	Followers  int
	Sfollowers string
	Fans       int
	Fans_lst   int
	Level      int
	Slevel     string
	//      APIで取得できるデータ(2)
	Order        int
	Point        int //     イベント終了後12時間〜36時間はイベントページから取得できることもある
	Spoint       string
	Istarget     string
	Graph        string
	Iscntrbpoint string
	Color        string
	Colorvalue   string
	//	Colorinflist ColorInfList
	Formid      string
	Eventid     string
	Status      string
	Statuscolor string
}

type RoomInfoList added in v1.4.0

type RoomInfoList []RoomInfo

func (RoomInfoList) Choose added in v1.4.0

func (r RoomInfoList) Choose(from, to int) (s RoomInfoList)

func (RoomInfoList) Len added in v1.4.0

func (r RoomInfoList) Len() int

sort.Sort()のための関数三つ

func (RoomInfoList) Less added in v1.4.0

func (r RoomInfoList) Less(i, j int) bool

降順に並べる

func (RoomInfoList) Swap added in v1.4.0

func (r RoomInfoList) Swap(i, j int)

type RoomVisit

type RoomVisit struct {
	Rvlfn     string
	Category  string
	Roomvisit map[int]time.Time
}

訪問済みルーム情報

func (*RoomVisit) Restore

func (r *RoomVisit) Restore(
	category string,
	rvlfn string,
	aplmin int,
) (
	err error,
)

配信ルーム訪問情報の読み込み

func (*RoomVisit) Save

func (r *RoomVisit) Save() (
	err error,
)

配信ルーム訪問情報の書き出し

Jump to

Keyboard shortcuts

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