todo: profile live
This commit is contained in:
parent
925b7d42c7
commit
ee28db4ad8
|
@ -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
Loading…
Reference in New Issue
Block a user