srapi

package module
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 22 modules, 23 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

※ システム全体の構成要素と各要素の整合性のとれるバージョンについてはSRCGI - READMEの末尾にあります

srapi

API of video distribution service SHOWROOM and its usage

SHOWROOMのAPI、その使い方とサンプルソース

  【Windows】Githubにあるサンプルプログラムの実行方法

  【Unix/Linux】Githubにあるサンプルプログラムの実行方法

Documentation

Overview

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

Ver. 0.0.0 srapi.goから分離する。 Ver. 1.0.0 戻り値 status を err に変更する。

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

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

Copyright © 2024 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.0 srapi.goから分離する。 Ver. 1.0.0 戻り値 status を err に変更する。 Ver. 1.1.1 ダミーのユーザーエージェントを FireFox/124.0に変更する。

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

Ver. 1.1.1 Contribution_ranking.Me のtypeをanyからinterface{}に変更する。

Copyright © 2024 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.1.0

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

Ver. 0.1.0

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

Ver. 0.1.0

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

Ver. 0.1.0

! Copyright © 2024 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.1.0 ApiLiveCurrentUser.goをsrapi.goから分離する。ApiLiveCurrentUser()のRoomIDをstring型に変更する。 Ver. 1.0.0 戻り値 status を err に変更する。

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

Ver. 0.0.0 Ver. 1.0.0 戻り値 status を err に変更する。 Ver. 2.0.0 ExtrRoomLiveByCtg()とExtrRoomLiveByGnr()をRoomOnlivesのメソッドとする。 Ver. 2.0.1 fmt.Errorf()の %v を %w に変更する。 Ver. 3.0.0 ExtrRoomLiveByCtg(), ExtrRoomLiveyypByGnr()をそれぞれExtrByCtg()、ExtrByCtg()に変更する。 Ver. 4.0.0 ExtrByCtg()、ExtrByCtg()の引数を Roomonlives から *RoomOnLives に変更する。 Ver. 4.1.0 上位でsort.Sort()をsort.Slice()に変更したため、sort.Sort()のためのメソッドを削除する。 Ver. 4.1.0 ExtrByCtg()の引数を Roomonlives から *RoomOnLives に変更する(修正もれ)

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

Ver. 0.1.0

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

Ver. 0.0.0 Ver. 0.1.0 レベルイベントのRankとGapを−1とする。

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

Ver. 0.1.0

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

Ver. 0.1.0

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

Ver. 0.1.0

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

Ver. 0.0.0 Ver. 0.1.0 リスナー情報 UserDetail にエラーに関するメンバーを追加する(作成済みのプログラムに影響はない) Ver. 1.0.0 戻り値の staus を error 変更する Ver. 1.1.0 err に fmt.Errorf("package.Function: %w", err) を設定する。

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

Ver. 0.0.0 srapi.goから分離する。 Ver. 1.0.0 戻り値の staus を error 変更する

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

Ver. 0.1.0

Index

Constants

View Source
const Version = "01AH01"

00AA00 v1.3.0に対し

ApiRoomProfile()をApiRoomProfileV111()とする。
ApiRoomProfileAll()をApiRoomRoomProfile()とする。
ApiMission()を追加する。
srapi.goを追加する(Versionおよびuseragent)

00AA01 ApiEventRanking()のイベント終了後の動作を調べコメントに記す。 00AA02 EventRankingのメンバーにErrorsを追加する。ApiRoomProfile()でDecodeのエラー出力を簡略化する。 00AA03 ApiRoomProfile()でエラー出力を行わないようにする。 00AA04 ApiEventsRanking() の event_block_id を event_block_division_id とする 00AB00 ApiEventBlockRanking()を複数ページに対応させる。

ApiEventRoomList_test.goとApiEventBlockRanking.goを作成する。
importのgithub.com/chouette2100をChouette2100に変更する。

00AC00 ApiEventGiftRanking()をあらたに作成する 00AD00 ApiCdnGiftRanking(), ApiCdnUserGiftRanking()をあらたに作成する 00AD01 ApiCdnGiftRanking(), ApiCdnUserGiftRanking()で構造体にErrorsを追加する 00AD02 ApiCdnGiftRanking(), ApiCdnUserGiftRanking()の構造体を展開する。 00AE00 ApiCdnGiftRankingContribution()をあらたに作成する 00AE01 ApiCdnGiftRankingContribution()でtype名GrcRankingListをGrcRankingに変更する 00AF00 ApiCdnSeasonAwardRanking()をあらたに作成する 01AA00 ApiRoomEventAndSupport()の構造体を変更し、GetPointByAPI()の引数にBlockIDを追加する 01AH00 GetPointByApi() で レベルイベントの場合は順位に レベル - 10000 を設定する 01AH01 ApiRoomEventAndSupport()の構造体でanyをinterface{}に変更する

Variables

View Source
var GenreTbl []Genre = []Genre{
	{"総合", 999},
	{"フリー", 200},
	{"タレント・モデル", 103},
	{"ミュージック", 101},
	{"声優・アニメ", 104},
	{"お笑い・トーク", 105},
	{"バーチャル", 107},
	{"新人", 998},
}
View Source
var PrdMap map[string]int = map[string]int{
	"all":     0,
	"daily":   1,
	"weekly":  2,
	"monthly": 3,
}

Functions

func ApiCsrftoken

func ApiCsrftoken(
	client *http.Client,
) (
	csrftoken string,
	err error,
)

csrf_tokenを取得する。

func CrawlEventRoomList added in v0.5.0

func CrawlEventRoomList(valuehtml string,
	roomlist *[]Room,
	usernomap *map[int]bool,
	ib int,
	ie int,
	it *int,
) (
	err error,
)

func CrawlRoomRanking added in v1.3.0

func CrawlRoomRanking(
	mode string,
) (
	rr *[]RoomRanking,
	err error,
)

CrawlRoomRanking()

func GetGenreRankingByApi added in v1.3.0

func GetGenreRankingByApi(
	client *http.Client,
	genreid int,
	period string,
	iscurrent bool,
	pages int,
) (
	rlist *[]GenreRanking,
	err error,
)

func GetPointByApi added in v0.1.0

func GetPointByApi(
	client *http.Client,
	roomid int,
) (
	point int,
	rank int,
	gap int,
	eventid int,
	eventurl string,
	eventname string,
	blockid int,
	err error,
)

イベントでの獲得ポイントを取得する

Types

type ActiveFanNextLevel

type ActiveFanNextLevel struct {
	Level      int //	現在のファンレベル
	Next_level struct {
		Level      int //	次のファンレベル
		Conditions []struct {
			Condition_details []struct {
				Goal  int    //	次のレベルになるのに必要な要素(視聴時間、ギフト、コメントの数)
				Unit  string //	単位(分、pt、G、コメント)
				Value int    //	(レベルアップに使った分を除く)現在の実績(手持ちの要素数)(視聴時間、ギフト、コメントの数)
				Label string //	次のレベルになるのに必要な要素の詳細(視聴時間、無料ギフト、有料ギフト、コメント数)
			}
			Label string //	次のレベルになるのに必要な要素(視聴時間、有料ギフト or 無料ギフト、コメント数)
		}
	}
	Title_id int //	不明
}

ファンレベルの進捗状況の詳細

func ApiActivefanNextlevel

func ApiActivefanNextlevel(
	client *http.Client,
	userid string,
	roomid string,
) (
	afnl ActiveFanNextLevel,
	err error,
)

ファンレベルの進捗状況を得るためのAPI(/api/active_fan/next_level)を実行する。

type ActivefanRoom added in v1.3.0

type ActivefanRoom struct {
	LevelImageBaseURL string `json:"level_image_base_url"`
	TotalUserCount    int    `json:"total_user_count"`
	ImageVersion      int    `json:"image_version"`
	FanPower          int    `json:"fan_power"`
	IsExcluded        bool   `json:"is_excluded"`
	TitleImageBaseURL string `json:"title_image_base_url"`
	FanName           string `json:"fan_name"`
}

func ApiActivefanRoom added in v1.3.0

func ApiActivefanRoom(
	client *http.Client,
	room_id string,
	ym string,
) (
	pafr *ActivefanRoom,
	err error,
)

type Block_ranking added in v0.6.0

type Block_ranking struct {
	//	boolとintのinterface{}型はデータ取得時にbool型として値を設定しておくこと
	//	該当する変数を使うときは一律に if br.Is_official.(bool) { ... } のようにすればよい
	Is_official      interface{} //	block_id != 0のとき false/true, bock_id == 0 のとき 0/1
	Room_url_key     string
	Room_description string
	Image_s          string
	Is_online        interface{} //	block_id != 0のとき false/true, bock_id == 0 のとき 0/1
	Is_fav           bool
	Genre_id         int
	Point            int
	Room_id          string
	Rank             int
	Room_name        string
}

type BulkGiftingFree added in v0.2.0

type BulkGiftingFree struct {
	Ua              int         //	3: ?
	Aft             int         //	0: ?
	Gifting_bonus   interface{} //	null: ? 現時点では型が不明
	Ok              bool        //	true: 正常終了?
	Notify_level_up bool        //	false: ?
	Gifts           []struct {
		Gift_id   int //	(Official) 1, 2, 1001, 1002, 1003, (Free) 1501, 1502, 1503, 1504. 1505
		Add_point int //	ボーナスを含んだ獲得ポイント

		Remaining_num int     //	残りの星、種の個数(呼び出し後は0になっているはず)
		Gift_name     string  //	ギフト名 (Offiicial) "星A", "星B", "星C", "星D", "星E",(Free)"種A", "種B", "種C", "種D", "種E"
		Bonus_rate    float64 //	ボーナス率(num >= 10であれば0.2)
		Gift_type     int     //	2: ?
		// contains filtered or unexported fields
	}
	Fan_level struct {
		Next_level_point    int //	未確認
		Current_level_point int //	未確認
		Next_fan_level      int //	未確認
		Contribution_point  int //	累積貢献ポイント ?
		User_id             int //	リスナーの識別子
		Fan_level           int //	いわゆるリスナーレベル(現時点で最大値 56)
	}
	Level_up string //	"0": ?
}

星・種の一気投げの結果

func ApiLiveBulkGiftingFree added in v0.2.0

func ApiLiveBulkGiftingFree(
	client *http.Client,
	csrftoken string,
	liveid string,
) (
	bulkgiftingfree *BulkGiftingFree,
	err error,
)

星・種をまとめて投げる

type CdnGiftRanking added in v1.4.0

type CdnGiftRanking struct {
	TotalScore  int         `json:"total_score"`
	RankingList []GrRanking `json:"ranking_list"`
	Errors      []struct {
		ErrorUserMsg string `json:"error_user_msg"`
		Message      string `json:"message"`
		Code         int    `json:"code"`
	} `json:"errors"`
}

func ApiCdnGiftRanking added in v1.4.0

func ApiCdnGiftRanking(
	client *http.Client,
	genre_id int,
	limit int,
) (
	pranking *CdnGiftRanking,
	err error,
)

ギフトランキングを取得する

(イベントギフトランキングとは別のものです)
https://public-api.showroom-cdn.com/gift_ranking/mmm?limit=nnn		mmm: ジャンルID nnn; 最大取得件数

|コード|名称|補足|
|---|---|---|
|486|人気ライバーランキング||
|490|新人スタートダッシュ||
|494|アイドル||
|495|俳優||
|496|アナウンサー||
|497|グローバル||
|498|声優||
|499|芸人||
|500|タレント||
|501|ライバー||
|502|モデル||
|503|バーチャル||
|504|アーティスト||

func ApiCdnSeasonAwardRanking added in v1.6.1

func ApiCdnSeasonAwardRanking(
	client *http.Client,
	gift_id int,
	limit int,
) (
	pranking *CdnGiftRanking,
	err error,
)

SeasonAwardRankingを取得する

(イベントギフトランキングとは別のものです)
https://public-api.showroom-cdn.com/gift_ranking/mmm?limit=nnn		mmm: ジャンルID nnn; 最大取得件数

|コード|名称|補足|
|---|---|---|
|486|人気ライバーランキング||
|490|新人スタートダッシュ||
|494|アイドル||
|495|俳優||
|496|アナウンサー||
|497|グローバル||
|498|声優||
|499|芸人||
|500|タレント||
|501|ライバー||
|502|モデル||
|503|バーチャル||
|504|アーティスト||

type CdnUserGiftRanking added in v1.4.0

type CdnUserGiftRanking struct {
	RankingList []UgrRanking `json:"ranking_list"`
	Errors      []struct {
		ErrorUserMsg string `json:"error_user_msg"`
		Message      string `json:"message"`
		Code         int    `json:"code"`
	} `json:"errors"`
}

func ApiCdnUserGiftRanking added in v1.4.0

func ApiCdnUserGiftRanking(
	client *http.Client,
	genre_id int,
	limit int,
) (
	pranking *CdnUserGiftRanking,
	err error,
)

ユーザーギフトランキングを取得する

https://public-api.showroom-cdn.com/user_gift_ranking/mmm?limit=nnn

type ContributionRanking added in v1.8.0

type ContributionRanking struct {
	UserID    int    `json:"user_id"`
	Name      string `json:"name"`
	Point     int    `json:"point"`
	Rank      int    `json:"rank"`
	AvatarID  int    `json:"avatar_id"`
	AvatarURL string `json:"avatar_url"`
}

type Contribution_ranking added in v1.1.0

type Contribution_ranking struct {
	Ranking []struct {
		AvatarID  int    `json:"avatar_id"`
		Point     int    `json:"point"`
		AvatarURL string `json:"avatar_url"`
		Name      string `json:"name"`
		UserID    int    `json:"user_id"`
		Rank      int    `json:"rank"`
	} `json:"ranking"`
	Me      interface{} `json:"me"`
	MyPoint int         `json:"my_point"`
	Event   struct {
		EndedAt     int    `json:"ended_at"`
		EventName   string `json:"event_name"`
		EventType   string `json:"event_type"`
		StartedAt   int    `json:"started_at"`
		EventURL    string `json:"event_url"`
		ShowRanking int    `json:"show_ranking"`
		Image       string `json:"image"`
	} `json:"event"`
}

func ApiEventContribution_ranking added in v1.1.0

func ApiEventContribution_ranking(
	client *http.Client,
	ieventid int,
	roomid int,
) (
	pranking *Contribution_ranking,
	err error,
)

リスナー別の貢献ポイントを取得する

type CsrfToken

type CsrfToken struct {
	Csrf_token string
	Data1      string
}

csrf_token ... 接続の識別子

type EndAnimation added in v1.8.0

type EndAnimation struct {
	TriggerTime int `json:"trigger_time"`
	Value       int `json:"value"`
	Type        int `json:"type"`
}

type Event added in v0.2.0

type Event struct {
	Content_region_permission int
	Order_no                  int
	Event_id                  int //	イベント識別子
	Tag_list                  []struct {
		Tag_name string
	}
	Event_description     string
	Is_event_Block        bool
	Is_entry_scope_inner  bool //	対象者限定か否か(?)
	Start_soon            bool
	League_ids            []int //	val.= 9:XX, 10:S, 20:A, 30:B, 40:C (?)
	End_soon              bool
	Type_name             string
	Is_official           bool
	Event_name            string //	イベント名
	Image_l               string
	Event_type            string
	Image_s               string
	Genre_id              int
	Default_locale        string
	Ended_at              int64 //	イベント終了日時(UnixTime)
	Updated_at            int64
	Start_comming         interface{}
	Event_block_label     interface{}
	Event_image_file_type string
	Required_level_max    int //	参加可能レベル上限
	Required_level        int //	参加可能レベル下限
	Image_m               string
	Offer_started_at      int64
	No_amateur            bool
	End_remain            interface{}
	Just_offer_started    interface{}
	Created_at            int64
	Started_at            int64  //	イベント開始日時(UnixTime)
	Event_url_key         string //	イベントURL(最後のフィールド)
	Is_box_event          bool   //	親イベントか否か(?)
	Parent_event_id       int
	Show_ranking          bool
	Is_watch              bool
	Is_public             bool
	Public_status         int
	Is_closed             bool
	Is_pickup             bool
	Reward_rank           int
	Offer_ended_at        int64 //	申込み終了日時(UnixTime)
}

func MakeEventListByApi added in v0.2.0

func MakeEventListByApi(client *http.Client, args ...int) (esl []Event, err error)

複数ページにわかれたイベント情報を取得して一つのスライスにする。

MakeEventListByApi(client, client)
MakeEventListByApi(client, client, status)
 status: 1: 開催中(デフォルト)、 3: 開催予定、 4: 終了済み

type EventBlockRanking added in v0.6.0

type EventBlockRanking struct {
	Total_entries      int
	Entries_per_pages  int
	Current_page       int
	Block_ranking_list []Block_ranking
}

func ApiBlockEventRnaking added in v0.6.0

func ApiBlockEventRnaking(
	client *http.Client,
	event_id int,
	block_id int,
	page int,
) (
	ebr *EventBlockRanking,
	err error,
)

func GetEventBlockRanking added in v0.6.0

func GetEventBlockRanking(
	client *http.Client,
	eventid int,
	blockid int,
	ib int,
	ie int,
) (
	ebr *EventBlockRanking,
	err error,
)

ブロックランキングイベント参加中のルーム情報の一覧を取得する。

type EventGiftRanking added in v1.4.0

type EventGiftRanking struct {
	RankingType int `json:"ranking_type"` //	1: ?
	RankingList []struct {
		OrderNo int `json:"order_no"` //	順位(1〜)
		Score   int `json:"score"`    //	獲得ポイント
		Room    struct {
			IsOfficial      int    `json:"is_official"`      //	公式?
			RoomURLKey      string `json:"room_url_key"`     //	配信画面のURLから"https://www.showroom-live.com/r/"を除いたもの
			RoomDescription string `json:"room_description"` //	ルーム説明
			ImageS          string `json:"image_s"`          //	サムネール
			RoomName        string `json:"room_name"`        //	ルーム名
			RoomID          string `json:"room_id"`          //	ルームID(整数 〜6桁)
			IsOnline        int    `json:"is_online"`        //	配信中?
		} `json:"room"`
		CreatedAt          int    `json:"created_at"`            //	2024-09-06 09:25 に gift_id=1497のとき 1725582065(2024-09-06 09:21:05)
		UpdatedAt          int    `json:"updated_at"`            //	〃
		EventGiftRankingID int    `json:"event_gift_ranking_id"` //	gift_id
		Rank               int    `json:"rank"`                  //	順位(= OrderNo ?)
		RoomID             string `json:"room_id"`               //	ルームID( = Room.RoomID ? )
	} `json:"ranking_list"`
	GiftData []struct {
		GiftID      int    `json:"gift_id"` //	ギフトID
		Name        string `json:"name"`    //	ギフト名
		IsAnimation int    `json:"is_animation"`
		Path        string `json:"path"` //	ギフト画像
	} `json:"gift_data"`
	Errors []struct {
		ErrorUserMsg string `json:"error_user_msg"`
		Message      string `json:"message"`
		Code         int    `json:"code"`
	} `json:"errors"`
}

func ApiEventGiftRanking added in v1.4.0

func ApiEventGiftRanking(
	client *http.Client,
	gift_id int,
) (
	pranking *EventGiftRanking,
	err error,
)

イベントギフトランキングを取得する

(ギフトランキング、ユーザーギフトランキングとは別のものです)
https://www.showroom.com/api/event_gift_ranking/nnnnnnn		nnnnnn: gift_id
取得に期限はないようで EventRankingID=1 にたいしてもそれらしい結果が得られている。

type EventRoomList added in v0.5.0

type EventRoomList struct {
	Next_page int
	Html      string
}

func ApiEventRoomList added in v0.5.0

func ApiEventRoomList(
	client *http.Client,
	eventid int,
	page int,
) (
	eventroomlist *EventRoomList,
	err error,
)

配信状況を確認し、room_url_key から room_id を取得する。

type EventSearch added in v0.2.0

type EventSearch struct {
	Next_page     int
	Previous_page int
	Last_page     int //	ページ数、この数だけ取得を繰り返す。
	First_page    int
	Current_page  int
	Total_count   int //	イベント数、イベント情報取得後数が一致しているかチェックする。
	Event_list    []Event
}

func ApiEventSearch added in v0.2.0

func ApiEventSearch(
	client *http.Client,
	args ...int,
) (
	es *EventSearch,
	err error,
)

type Eventranking added in v1.1.0

type Eventranking struct {
	Ranking []struct {
		Point int `json:"point"`
		Room  struct {
			Name        string `json:"name"`
			ImageSquare string `json:"image_square"`
			RoomID      int    `json:"room_id"`
			Image       string `json:"image"`
		} `json:"room"`
		Rank int `json:"rank"`
	} `json:"ranking"`
	TargetRoomRanking struct {
		Gap   int `json:"gap"`
		Point int `json:"point"`
		Room  struct {
			Name        string `json:"name"`
			ImageSquare string `json:"image_square"`
			RoomID      int    `json:"room_id"`
			Image       string `json:"image"`
		} `json:"room"`
		Rank     int `json:"rank"`
		LowerGap int `json:"lower_gap"`
	} `json:"target_room_ranking"`
	Event struct {
		EndedAt     int    `json:"ended_at"`
		EventName   string `json:"event_name"`
		StartedAt   int    `json:"started_at"`
		EventType   string `json:"event_type"`
		EventURL    string `json:"event_url"`
		Image       string `json:"image"`
		ShowRanking int    `json:"show_ranking"`
	} `json:"event"`
	Errors []struct {
		ErrorUserMsg string `json:"error_user_msg"`
		Message      string `json:"message"`
		Code         int    `json:"code"`
	} `json:"errors"`
}

func ApiEventsRanking added in v1.1.0

func ApiEventsRanking(
	client *http.Client,
	ieventid int,
	roomid int,
	blockid int,
) (
	pranking *Eventranking,
	err error,
)

イベントに参加しているルームの中で上位50ルームの獲得ポイントを取得する

イベント最終結果発表後1日間は上位30ルームの最終結果を取得することができる。
イベント最終結果発表後1日をすぎると得られる獲得ポイントには0がセットされている。

type FollowRooms added in v0.6.0

type FollowRooms struct {
	Next_page     int //  次ページのページ番号、null: 次ページなし
	Previous_page int //  前ページのページ番号、null: 前ページなし
	Total_Entries int //  フォローしている配信者の数
	First_page    int //  最初のページのページ番号(常に1 ?)
	Current_page  int //  現在のページのページ番号
	Rooms         []RoomFollowed
}

func ApiFollowRooms added in v0.6.0

func ApiFollowRooms(
	client *http.Client,
	page int,
	count int,
) (
	followrooms *FollowRooms,
	err error,
)

フォローしているルームの一覧を指定した範囲で取得する。

type Genre added in v1.3.0

type Genre struct {
	Genre   string
	GenreID int
}

type GenreRanking added in v1.3.0

type GenreRanking struct {
	BeforeRank int `json:"before_rank"`
	OrderNo    int `json:"order_no"`
	Point      int `json:"point"`
	Room       struct {
		RoomURLKey  string `json:"room_url_key"`
		ImageSquare string `json:"image_square"`
		RoomName    string `json:"room_name"`
		RoomID      int    `json:"room_id"`
		Image       string `json:"image"`
	} `json:"room"`
	Rank int `json:"rank"`
}

type GenreRankingArray added in v1.3.0

type GenreRankingArray struct {
	NextPage     int            `json:"next_page"`
	GenreRanking []GenreRanking `json:"genre_ranking"`
	TotalCount   int            `json:"total_count"`
}

func ApiGenre_ranking added in v1.3.0

func ApiGenre_ranking(
	client *http.Client,
	genreid int,
	period string,
	iscurrent bool,
	page int,
	count int,
) (
	pgr *GenreRankingArray,
	err error,
)
func ApiGenre_ranking() ランキング一覧を取得する。

APIの使用例
https://www.showroom-live.com/api/genre_ranking/{genreid}/{period}?page=1&count=20

genreid: 0 全て 101 アーティスト 102 アイドル 103 タレント 104 声優 105 芸人 107 バーチャル 108 モデル 109 俳優 110 アナウンサー 111 グローバル 200 ライバー

period: all_time 総合 annually/20240101 monthly/20240601 weekly/20240603 ... 月曜日 daily/20240605

type GiftRankingContribution added in v1.5.0

type GiftRankingContribution struct {
	Room        GrcRoom      `json:"room"`
	RankingList []GrcRanking `json:"ranking_list"`
}

func ApiCdnGiftRankingContribution added in v1.5.0

func ApiCdnGiftRankingContribution(
	client *http.Client,
	genre_id int,
	url_key string,
) (
	pranking *GiftRankingContribution,
	err error,
)

ギフトランキングの獲得ギフトに対するリスナー貢献ランキングを取得する

https://public-api.showroom-cdn.com/gift_ranking/492/contribution/kogachan

type GrRanking added in v1.4.1

type GrRanking struct {
	RoomID  int    `json:"room_id"`
	Rank    int    `json:"rank"`
	Score   int    `json:"score"`
	OrderNo int    `json:"order_no"`
	Room    GrRoom `json:"room"`
}

type GrRoom added in v1.4.1

type GrRoom struct {
	ID               int    `json:"id"`
	Name             string `json:"name"`
	URLKey           string `json:"url_key"`
	ImageURL         string `json:"image_url"`
	Description      string `json:"description"`
	FollowerNum      int    `json:"follower_num"`
	IsLive           bool   `json:"is_live"`
	IsParty          bool   `json:"is_party"`
	NextLiveSchedule int    `json:"next_live_schedule"`
}

type GrcRanking added in v1.5.1

type GrcRanking struct {
	UserID  int     `json:"user_id"`
	Rank    int     `json:"rank"`
	Score   int     `json:"score"`
	OrderNo int     `json:"order_no"`
	User    GrcUser `json:"user"`
}

type GrcRoom added in v1.5.0

type GrcRoom struct {
	ID               int    `json:"id"`
	Name             string `json:"name"`
	URLKey           string `json:"url_key"`
	ImageURL         string `json:"image_url"`
	Description      string `json:"description"`
	FollowerNum      int    `json:"follower_num"`
	IsLive           bool   `json:"is_live"`
	IsParty          bool   `json:"is_party"`
	NextLiveSchedule int    `json:"next_live_schedule"`
}

type GrcUser added in v1.5.0

type GrcUser struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	AvatarURL string `json:"avatar_url"`
}

type Live

type Live struct {
	//	配信中ルーム情報ルーム
	Room_id      int    //	ルームID 配信者を識別する
	Room_url_key string //	配信のURLの最後のフィールド
	Live_id      int    //	Live ID 配信を識別する
	Started_at   int64  //	配信開始時刻(Unix Time)
	View_num     int    //	視聴者数
	Main_name    string //	ルーム名
	Genre_id     int    //	0: 人気、 200: フリー、 100(?)〜199(?): 公式、 700〜: 特定属性
}

type LiveCurrentUser

type LiveCurrentUser struct {
	Is_login           bool   //	ログインしているか? ログインしていればtrue
	User_id            int    //	リスナーの識別子
	Name               string //	リスナー名
	Fan_level          int    //	ファンレベル、Maxが56のやつ
	Add_free_gift      int    //	?
	Contribution_point int    //	おそらく貢献ポイントの累計
	Gift_list          struct {
		Normal []struct {
			Gift_id  int //	ギフトの種別 1であれば赤星、...
			Free_num int //	Gift_idのギフトの個数
		}
	}
}

リスナー情報

func ApiLiveCurrentUser

func ApiLiveCurrentUser(
	client *http.Client,
	roomid string,
) (
	livecurrentuser LiveCurrentUser,
	err error,
)

リスナーに関する情報を取得する

type LiveGiftingFree added in v0.2.0

type LiveGiftingFree struct {
	Ua              int     // ?
	Aft             int     // ?
	Num             int     // ?
	Remaining_num   int     // 星、種の残り個数
	Gifting_bonus   int     // ?
	Ok              bool    //	true: 正常終了?
	Notify_level_up bool    //	true: レベルアップ通知?
	Gift_id         int     //	(Official) 1, 2, 1001, 1002, 1003, (Free) 1501, 1502, 1503, 1504. 1505
	Add_point       int     //	ボーナスを含んだ獲得ポイント
	Gift_name       string  //	ギフト名 (Offiicial) "星A", "星B", "星C", "星D", "星E",(Free) "種A", "種B", "種C", "種D", "種E"
	Bonus_rate      float64 //	ボーナス率(num >= 10であれば0.2)
	Fan_Level       struct {
		Contribution_point int //	累積貢献ポイント ?
	}
}

func ApiLiveGiftingFree added in v0.2.0

func ApiLiveGiftingFree(
	client *http.Client,
	csrftoken string,
	liveid string,
	giftid string,
	num string,
) (
	livegiftingfree *LiveGiftingFree,
	err error,
)

星を投げる/種を投げる。

type LivePolling added in v0.4.0

type LivePolling struct {
	Is_login          bool //	ログインしているか?
	Show_login_dialog int
	Online_user_num   int //	視聴者数
	Active_fan        struct {
		Can_boostable bool
		User          struct {
			Before_level  int
			Titile_id     int
			Current_level int
		}
		Room struct {
			Total_user_count int    //
			Fan_name         string //	ファンの名称
		}
	}
	Live_watch_incentive struct {
		Ok         int    //	1:星・種をもらえた
		Is_amateur string // 	"1": フリー
	}
	Toast struct {
		Message string //	星・種集めのトーストの文面はここにある
	}
}

func ApiLivePolling added in v0.4.0

func ApiLivePolling(
	client *http.Client,
	room_id int,
) (
	livepolling *LivePolling,
	err error,
)

星・種をもらえたことを確認する。 配信状況を確認し、room_url_key から room_id を取得する。

type Lives

type Lives []Live

type Mission added in v1.4.0

type Mission struct {
	GenreList []struct {
		Priority      int    `json:"priority"`
		CurrentPeriod string `json:"current_period"`
		Night         struct {
			SingleMission []struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"`
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"`
			} `json:"single_mission"`
			CompositeMission struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"`
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"`
			} `json:"composite_mission"`
			EndAt             int `json:"end_at"`
			ContinuousMission []struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"` //	視聴が終わったルームの数
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"` //	"配信を視聴しよう(20/20)"
			} `json:"continuous_mission"`
			StartAt int `json:"start_at"`
		} `json:"night"`
		Day struct {
			SingleMission []struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"`
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"`
			} `json:"single_mission"`
			CompositeMission struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"`
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"`
			} `json:"composite_mission"`
			EndAt             int `json:"end_at"`
			ContinuousMission []struct {
				Reward       string `json:"reward"`
				RemainReward int    `json:"remain_reward"`
				TargetValue  int    `json:"target_value"`
				MissionID    int    `json:"mission_id"`
				MaxLevel     int    `json:"max_level"`
				CurrentLevel int    `json:"current_level"`
				RewardType   string `json:"reward_type"`
				RewardID     int    `json:"reward_id"`
				RewardNum    int    `json:"reward_num"`
				CurrentValue int    `json:"current_value"`
				RewardURL    string `json:"reward_url"`
				Title        string `json:"title"`
				RewardName   string `json:"reward_name"`
			} `json:"continuous_mission"`
			StartAt int `json:"start_at"`
		} `json:"day"`
		Name           string `json:"name"`
		MissionGenreID int    `json:"mission_genre_id"`
		Genre          string `json:"genre"`
	} `json:"genre_list"`
}

func ApiMission added in v1.4.0

func ApiMission(
	client *http.Client,
	room_id string,
) (
	pmission *Mission,
	err error,
)

ミッション・デイリー(昼/夜)の進捗状況を取得する。 ログインして実行すること

type Quest added in v1.8.0

type Quest struct {
	QuestLevel          int         `json:"quest_level"`
	Support             Support     `json:"support"`
	QuestList           []QuestList `json:"quest_list"`
	Text                string      `json:"text"`
	ContributorListURL  string      `json:"contributor_list_url"`
	IsAllQuestCompleted int         `json:"is_all_quest_completed"`
}

type QuestList added in v1.8.0

type QuestList struct {
	SupportID     int    `json:"support_id"`
	QuestLevel    int    `json:"quest_level"`
	Title         string `json:"title"`
	GoalPoint     int    `json:"goal_point"`
	NumberOfItems int    `json:"number_of_items"`
	RestItems     int    `json:"rest_items"`
	Color         string `json:"color"`
	IsAcquired    bool   `json:"is_acquired"`
}

type ResEvent added in v1.8.0

type ResEvent struct {
	EventID                 int                   `json:"event_id"`
	EventName               string                `json:"event_name"`
	Image                   string                `json:"image"`
	EventURL                string                `json:"event_url"`
	EndAnimation            []EndAnimation        `json:"end_animation"`
	EventType               string                `json:"event_type"`
	StartedAt               int                   `json:"started_at"`
	EndedAt                 int                   `json:"ended_at"`
	RemainTime              int                   `json:"remain_time"`
	EventDescription        string                `json:"event_description"`
	AdditionalEventPoints   []interface{}         `json:"additional_event_points"`
	AdditionalEventPointSum int                   `json:"additional_event_point_sum"`
	TutorialURL             string                `json:"tutorial_url"`
	ContributionRanking     []ContributionRanking `json:"contribution_ranking"`
	Quest                   Quest                 `json:"quest"`
	ShowRanking             int                   `json:"show_ranking"`
	ResRanking              ResRanking            `json:"ranking"`
}

type ResRanking added in v1.8.0

type ResRanking struct {
	BeforeRank           int    `json:"before_rank"`
	MaxRank              int    `json:"max_rank"`
	Point                int    `json:"point"`
	Gap                  int    `json:"gap"`
	Text                 string `json:"text"`
	SequenceNum          int    `json:"sequence_num"`
	IsAnimation          int    `json:"is_animation"`
	NextRank             int    `json:"next_rank"`
	Rank                 int    `json:"rank"`
	LargeRank            int    `json:"large_rank"`
	LowerRank            int    `json:"lower_rank"`
	LowerGap             int    `json:"lower_gap"`
	EventBlockDivisionID int    `json:"event_block_division_id"`
}

type Room added in v0.5.0

type Room struct {
	Room_id      int
	Room_url_key string
	Room_name    string
	Point        int //	これは /event/room_list の戻り値には含まれない。以下同様
	Gap          int
	Rank         int
	Islive       bool
	Isofficial   bool
	Startedat    int64
	Nextlive     int64
}

type RoomEvnetAndSupport added in v0.1.0

type RoomEvnetAndSupport struct {
	Support      interface{} `json:"support"`
	ResEvent     ResEvent    `json:"event"`
	RegularEvent interface{} `json:"regular_event"`
}
イベントの順位と獲得ポイント

// JSONには他にもいろんなフィールドがあります。 // ぜったい必要そうなものとフィールドの作りが面倒そうなところだけ構造体にしてあります。

type RoomEvnetAndSupport struct {
	Event struct {
		Event_id   int      //	イベント識別子
		Event_url  string   //	イベントのURLの末尾のフィールド
		Event_name string   //	イベント名
		Ranking   struct { //	ランキングイベントのポイントデータ
			Rank  int //	順位
			Point int //	獲得ポイント
			Gap   int //	上位とのポイント差
		}
		Quest struct { //	レベルイベントのポイントデータ
			Support struct {
				Goal_point    int //	目標ポイント
				Current_point int //	現在のポイント
				Support_users []struct {
					Point int //	ポイント
					Order int //	順位
					Name string //	ユーザー名
					User_id int //	ユーザー識別子
				}
			}
			Quest_list []struct {
				Number_of_items int //	アイテム数
				Color		   string//	色
				Goal_point	  int //	目標ポイント
				Rest_time	  int //	残り時間?
				Title	  string//	タイトル
				Quest_level	  int //	クエストレベル
				Is_aquired	  bool//	クエスト獲得フラグ?
			}
		}
	}
}

func ApiRoomEventAndSupport added in v0.1.0

func ApiRoomEventAndSupport(
	client *http.Client,
	roomid string,
) (
	res *RoomEvnetAndSupport,
	err error,
)

イベントの順位と獲得ポイントを知るAPI(/api/room/event_and_suport)を実行する。

type RoomFollowed added in v0.6.0

type RoomFollowed struct {
	Is_official      int    // 0:Free, 1:Official
	Image_l          string //  画像
	Room_description string //  ルーム概要
	Room_url_key     string //  配信ページのURLの最後のフィールド
	Next_live        string //	"未定"または"11/25 18:00"の形式
	Image_m          string //  未確認
	Has_next_live    int    //  null:配信予定なし, 1:配信予定あり
	Is_online        int    //  0:  配信中ではない,
	Room_id          string //  RoomIDを文字列にしたもの
	Room_name        string //  ルーム名
	Open_fan_club    int    //  null:ファンルームなし、1:ファンルームあり
}

func GetFollowRoomsByApi added in v0.6.0

func GetFollowRoomsByApi(
	client *http.Client,
) (
	roomsfollowed []RoomFollowed,
	err error,
)

フォローしているすべてのルームの一覧を取得する。

type RoomInf added in v1.0.0

type RoomInf 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      int
	Prank      int
	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
}

func ApiRoomProfileV111 added in v1.4.0

func ApiRoomProfileV111(
	client *http.Client,
	room_id string,
) (
	roominf RoomInf,
	err error,
)

type RoomInfAll added in v1.3.0

type RoomInfAll struct {
	PrevLeagueID int `json:"prev_league_id"`
	ImageList    []struct {
		MOriginal string `json:"m_original"`
		Ts        int    `json:"ts"`
		ID        int    `json:"id"`
		M         string `json:"m"`
	} `json:"image_list"`
	BannerList []struct {
		URL   string `json:"url"`
		Image string `json:"image"`
	} `json:"banner_list"`
	IsTalkOnline   bool        `json:"is_talk_online"`
	AwardList      interface{} `json:"award_list"` //	<== 要確認
	PushSendStatus struct {
	} `json:"push_send_status"`
	PerformerName      string `json:"performer_name"`
	FollowerNum        int    `json:"follower_num"` //	フォロワー数
	LiveContinuousDays int    `json:"live_continuous_days"`
	NextLeagueID       int    `json:"next_league_id"`
	LiveID             int    `json:"live_id"`
	LeagueID           int    `json:"league_id"`
	IsOfficial         bool   `json:"is_official"`
	IsFollow           bool   `json:"is_follow"`
	VoiceList          []struct {
		MOriginal interface{} `json:"m_original"`
		Ts        int         `json:"ts"`
		ID        int         `json:"id"`
		M         string      `json:"m"`
	} `json:"voice_list"`
	ShowRankSubdivided string `json:"show_rank_subdivided"` //	現在のランク 例 SS-5
	Event              struct {
		EndedAt   int64  `json:"ended_at"`   //	unix time
		EventID   int    `json:"event_id"`   //	これが本来のイベント識別子?
		StartedAt int64  `json:"started_at"` //	unix time
		URL       string `json:"url"`        //	最後のフィールドが event_url_key (プログラム中ではこれを eventid としていることがある。
		Name      string `json:"name"`
		Label     struct {
			Color string `json:"color"`
			Text  string `json:"text"`
		} `json:"label"`
		Image string `json:"image"`
	} `json:"event"`
	IsBirthday  bool   `json:"is_birthday"`
	Description string `json:"description"`
	LiveTags    []struct {
		Name string `json:"name"`
		ID   int    `json:"id"`
	} `json:"live_tags"`
	GenreID         int `json:"genre_id"` //	101: Music,
	DisplayedMedals []struct {
		MedalID     int    `json:"medal_id"`
		EventName   string `json:"event_name"`
		MedalName   string `json:"medal_name"`
		Displayed   int    `json:"displayed"`
		ImageURL    string `json:"image_url"`
		Description string `json:"description"`
	} `json:"displayed_medals"`
	PrevScore            int    `json:"prev_score"` //	下位のランクまでのポイント
	YoutubeID            string `json:"youtube_id"`
	VisitCount           int    `json:"visit_count"`
	RecommendCommentList []struct {
		CreatedAt int    `json:"created_at"`
		Comment   string `json:"comment"`
		User      struct {
			Name  string `json:"name"`
			Image string `json:"image"`
		} `json:"user"`
	} `json:"recommend_comment_list"`
	CurrentLiveStartedAt   int64  `json:"current_live_started_at"` //	unix time
	NextShowRankSubdivided string `json:"next_show_rank_subdivided"`
	ShareTextLive          string `json:"share_text_live"`
	SnsList                []struct {
		Icon string `json:"icon"`
		URL  string `json:"url"`
		Name string `json:"name"`
	} `json:"sns_list"`
	RecommendCommentsURL    string `json:"recommend_comments_url"`
	ShareURL                string `json:"share_url"`
	RoomURLKey              string `json:"room_url_key"` // 配信画面のURLの最後のフィールド
	LeagueLabel             string `json:"league_label"` //	例 SS
	IsLiveTagCampaignOpened bool   `json:"is_live_tag_campaign_opened"`
	Avatar                  struct {
		Description string   `json:"description"`
		List        []string `json:"list"`
	} `json:"avatar"`
	ShareURLLive            string `json:"share_url_live"`
	PrevShowRankSubdivided  string `json:"prev_show_rank_subdivided"` //	例 SS-4
	IsTalkOpened            bool   `json:"is_talk_opened"`
	ImageSquare             string `json:"image_square"`
	RecommendCommentPostURL string `json:"recommend_comment_post_url"`
	GenreName               string `json:"genre_name"` //	ジャンル名
	RoomName                string `json:"room_name"`  //	ルーム名  = main_name ?
	Birthday                int64  `json:"birthday"`
	RoomLevel               int    `json:"room_level"` //	ルームレベル
	PartyLiveStatus         int    `json:"party_live_status"`
	Party                   struct {
	} `json:"party"`
	EcConfig struct {
		SalesAvailable int           `json:"sales_available"`
		IsExternalEc   int           `json:"is_external_ec"`
		Links          []interface{} `json:"links"`
	} `json:"ec_config"`
	Image                      string `json:"image"`
	RecommendCommentOpenStatus int    `json:"recommend_comment_open_status"`
	MainName                   string `json:"main_name"` //	ルーム名  = room_name ?
	ViewNum                    int    `json:"view_num"`
	HasMoreRecommendComment    bool   `json:"has_more_recommend_comment"`
	IsPartyEnabled             bool   `json:"is_party_enabled"`
	PremiumRoomType            int    `json:"premium_room_type"`
	NextScore                  int    `json:"next_score"` //	上位のランクまでのポイント
	IsOnlive                   bool   `json:"is_onlive"`
	RoomID                     int    `json:"room_id"` //	ルーム識別子
	//	エラーが発生したときのレスポンス
	Errors []struct {
		ErrorUserMsg string `json:"error_user_msg"`
		Message      string `json:"message"`
		Code         int    `json:"code"`
	} `json:"errors"`
}

func ApiRoomProfile added in v1.0.0

func ApiRoomProfile(
	client *http.Client,
	room_id string,
) (
	proominfall *RoomInfAll,
	err error,
)

type RoomListInf added in v0.5.0

type RoomListInf struct {
	RoomList []Room
}

func GetRoominfFromEventByApi added in v0.5.0

func GetRoominfFromEventByApi(
	client *http.Client,
	eventid int,
	ib int,
	ie int,
) (
	roomlistinf *RoomListInf,
	err error,
)

イベント参加中のルーム情報の一覧を取得する。

type RoomNextlive added in v0.5.0

type RoomNextlive struct {
	Epoch int64  //	次回配信開始時刻(UnixTime)
	Text  string //	次回配信開始時刻( "1/2 15:04" )
}

func ApiRoomNextlive added in v0.5.0

func ApiRoomNextlive(
	client *http.Client,
	room_id int,
) (
	roomnextlive *RoomNextlive,
	err error,
)

次回配信時刻を取得する

type RoomOnlives

type RoomOnlives struct {
	//	配信中ルーム一覧
	//	Onlives []OnLive //	ジャンルごとの配信中ルーム一覧
	Onlives []struct {
		Genre_id   int    //	0: 人気、 200: フリー、 100(?)〜199(?): 公式、 700〜: 特定属性
		Genre_name string //	ジャンル名
		Lives      Lives  //	配信中ルーム一覧
	}

	Bcsvr_post int
	Bcsvr_host string
}

func ApiLiveOnlives

func ApiLiveOnlives(
	client *http.Client,
) (
	roomonlives *RoomOnlives,
	err error,
)

配信中のルームの一覧を取得する

func (*RoomOnlives) ExtrByCtg

func (r *RoomOnlives) ExtrByCtg(
	tgt string,
) (
	roomlive *Lives,
	err error,
)

指定したカテゴリー("Liver", "exLiver", "All")のルーム一覧を作る。 "All"のときでもGenre_idが0や700以上は含まないので重複はない。

func (*RoomOnlives) ExtrByGnr

func (r *RoomOnlives) ExtrByGnr(
	gnr map[string]bool,
) (
	roomlive *Lives,
	err error,
)

指定したジャンルのルーム一覧を作る。

type RoomRanking added in v1.3.0

type RoomRanking struct {
	GenreID int
	Period  string
	Order   int
	Room_id int
}

type RoomStatus added in v0.3.0

type RoomStatus struct {
	Started_at               int64  //	配信開始時刻(UnixTime)
	Is_live                  bool   //	配信中か?
	Live_status              int    // 0|2
	Is_enquete               bool   //	アンケートが行われているか?
	Live_id                  int    //	配信の識別子
	Is_official              bool   //	公式か?
	Genre_id                 int    //	配信ジャンル(Freeだったら200みたいなの)
	Room_id                  int    //	ルームの識別子
	Room_name                string //	ルーム名
	Room_url_key             string //	配信時URLの最後のフィールド
	Is_owner                 bool
	Is_fav                   bool
	Youtube_id               string //	非配信時Youtube動画( https://www.youtube.com/watch?v=4{Youtube_id})
	Did_send_live_bad_report bool
	Can_comment              bool
	Background_image_url     string
	Video_type               int
	Broadcast_host           string
	Broadcast_port           int
	Broadcast_key            string
	Image_s                  string
	Nsta_owner               bool
	Live_type                int
	Live_user_key            string
	Share                    struct {
		Twitter struct {
			Text string
			Url  string
		}
	}
}

func ApiRoomStatus added in v0.3.0

func ApiRoomStatus(
	client *http.Client,
	room_url_key string,
) (
	roomstatus *RoomStatus,
	err error,
)

配信状況を確認し、room_url_key から room_id を取得する。

type RoomsPastevents added in v1.3.0

type RoomsPastevents struct {
	LastPage       int         `json:"last_page"`
	CurrentPage    int         `json:"current_page"`
	NextPage       int         `json:"next_page"`
	FavoriteEvents interface{} `json:"favorite_events"`
	TotalEntries   int         `json:"total_entries"`
	PreviousPage   int         `json:"previous_page"`
	Events         []struct {
		EventName   string `json:"event_name"`
		EventID     int    `json:"event_id"`
		EventType   string `json:"event_type"`
		Image       string `json:"image"`
		EndedAt     int    `json:"ended_at"`
		IsFavorite  int    `json:"is_favorite"`
		StartedAt   int    `json:"started_at"`
		ShowRanking int    `json:"show_ranking"`
	} `json:"events"`
	FirstPage int `json:"first_page"`
}

func ApiRoomsPast_events added in v1.3.0

func ApiRoomsPast_events(
	client *http.Client,
	roomid int,
	page int,
) (
	rpe *RoomsPastevents,
	err error,
)

指定したルームのこれまで参加したイベントの一覧を取得する。 ルームIDとページ番号を指定する。 ページ番号は1から始まる。

func GetRoomsPasteventsByApi added in v1.3.0

func GetRoomsPasteventsByApi(
	client *http.Client,
	roomid int,
) (
	roomspastevents *RoomsPastevents,
	err error,
)

指定したルームが過去にエントリーしたすべてのイベントを取得する

type Support added in v1.8.0

type Support struct {
	SupportID      int            `json:"support_id"`
	GoalPoint      int            `json:"goal_point"`
	IsAchieved     bool           `json:"is_achieved"`
	CurrentPoint   int            `json:"current_point"`
	NextLevel      int            `json:"next_level"`
	Title          string         `json:"title"`
	TutorialURL    string         `json:"tutorial_url"`
	SupportUsers   []SupportUsers `json:"support_users"`
	SupportMyPoint int            `json:"support_my_point"`
}

type SupportUsers added in v1.8.0

type SupportUsers struct {
	UserID    int    `json:"user_id"`
	Point     int    `json:"point"`
	Order     int    `json:"order"`
	Name      string `json:"name"`
	AvatarID  int    `json:"avatar_id"`
	AvatarURL string `json:"avatar_url"`
}

type UgrRanking added in v1.4.1

type UgrRanking struct {
	UserID  int     `json:"user_id"`
	Rank    int     `json:"rank"`
	Score   int     `json:"score"`
	OrderNo int     `json:"order_no"`
	User    UgrUser `json:"user"`
}

type UgrUser added in v1.4.1

type UgrUser struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	AvatarURL string `json:"avatar_url"`
}

type UserDetail

type UserDetail struct {
	User_id         int    //	ユーザーID=リスナーの識別子、ログインしていない場合は 0 となる。
	Name            string //	ユーザー名=リスナー名
	Age             int
	Regidence       int
	Description     string
	Image           string
	Birthday        string
	Is_ng_nick_name bool //	?

	//	エラー情報
	//	ログインしている場合は空配列となる模様。
	//	ログインしていない場合は
	//		Error_user_msg:	"Error occured"
	//		Message:		"Not Found"
	//		Code:			1002
	Errors []struct {
		Error_user_msg string //	エラーメッセージ
		Message        string //	エラー内容
		Code           int    //	エラーコード
	}
}

リスナー情報

func ApiUserDetail

func ApiUserDetail(
	client *http.Client,
) (
	userdetail *UserDetail,
	err error,
)

(ログインしている)リスナーの情報を取得する

type UserLogin

type UserLogin struct {
	Ok            int    //	1: ログインできた 0:ログインできなかった
	Is_room_owner int    //	未確認、おそらく配信者登録をしている(1)か否(0)かだと思う。
	User_id       string //	ログインできたときはリスナーの識別子(数字からなる文字列)
	Room_id       string //	未確認、おそらく配信ルームの識別子(数字からなる文字列 ?)
	Account_id    string //	ログインできたときはログインアカウント
}

ログインのAPIの結果

func ApiUserLogin

func ApiUserLogin(
	client *http.Client,
	csrftoken string,
	accountid string,
	password string,
) (
	userlogin UserLogin,
	err error,
)

SHOWROOMのサービスにログインする

Jump to

Keyboard shortcuts

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