for save.
This commit is contained in:
@@ -6,7 +6,7 @@ package main
|
||||
`anchor_id` varchar(255) NOT NULL,
|
||||
`anchor_name` varchar(255) NOT NULL,
|
||||
`live_url` text,
|
||||
`channel` varchar(128) DEFAULT NULL,
|
||||
`channel` varchar(128) DEFAULT NULL, // 没有分类
|
||||
`show_type` varchar(255) DEFAULT NULL,
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@ package main
|
||||
|
||||
import (
|
||||
"intimate"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
func TestExtractor(t *testing.T) {
|
||||
collect := intimate.NewExtractorStore()
|
||||
store := intimate.NewSourceStore("source_openrec")
|
||||
source, err := store.Pop("openrec_user", 100)
|
||||
if source != nil {
|
||||
@@ -24,11 +24,9 @@ func TestExtractor(t *testing.T) {
|
||||
m := result.Map()
|
||||
for key := range m {
|
||||
t.Error(key)
|
||||
f, err := os.OpenFile("./openrec_"+key+".html", os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
f.WriteString(m[key].String())
|
||||
ai := &intimate.CollectLog{}
|
||||
ai.SetAnchorId("123")
|
||||
collect.InsertCollectLog(ai)
|
||||
}
|
||||
} else {
|
||||
t.Error("data is not json:\n", string(sdata))
|
||||
|
||||
Reference in New Issue
Block a user