todo: profile live

This commit is contained in:
eson 2020-09-15 19:06:03 +08:00
parent 925b7d42c7
commit ee28db4ad8
2 changed files with 2324 additions and 75 deletions

View File

@ -1,7 +1,51 @@
package main
import "testing"
import (
"intimate"
"log"
"testing"
"time"
func TestDo(t *testing.T) {
"github.com/474420502/gcurl"
)
func main() {
ps := intimate.NewPerfectShutdown()
gprofile := gcurl.Parse(`https://www.mirrativ.com/api/user/profile?user_id=103383701`)
tpProfile := gprofile.CreateTemporary(nil)
tpProfileUserID := tpProfile.QueryParam("user_id")
g := gcurl.Parse(`https://www.mirrativ.com/api/live/live?live_id=O5Ia4iX9c5CeZj7DFtg52Q`)
tpLive := g.CreateTemporary(nil)
tpLiveID := tpLive.QueryParam("live_id")
queue := intimate.TStreamer.Queue(intimate.Streamer{}, intimate.ConditionDefault(intimate.PMirrativ))
for !ps.IsClose() {
istreamer, err := queue.Pop()
if err != nil {
log.Println(err)
time.Sleep(time.Second * 2)
continue
}
streamer := istreamer.(*intimate.Streamer)
userid := *streamer.UserId
tpProfileUserID.StringSet(userid)
resp, err := tpProfile.Execute()
if err != nil {
log.Println(err)
time.Sleep(time.Second)
continue
}
profilejson := gcurl.Parse(string(resp.Content()))
}
}
func TestDo(t *testing.T) {
main()
}

File diff suppressed because it is too large Load Diff