for save.

This commit is contained in:
eson
2020-07-10 18:31:17 +08:00
parent d5151f92bf
commit d258cc51d3
5 changed files with 29 additions and 21 deletions

View File

@@ -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,
*/

View File

@@ -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))