This commit is contained in:
eson 2018-12-20 01:54:48 +08:00
parent 0f40eedc28
commit efb9fe36a1

View File

@ -30,9 +30,9 @@ func (tt *Toutiao) GetSpiderID() int {
func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
log.Println(adstring)
adstring = strconv.QuoteToASCII(adstring)
adstring = strings.Replace(adstring, "\\", "", -1)
log.Println(adstring)
var adlist interface{}
if err := json.Unmarshal([]byte(adstring), &adlist); err != nil {
@ -51,6 +51,8 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
}
func TestParserToutiao(t *testing.T) {
log.SetFlags(log.Llongfile)
tt := Toutiao{}
tt.ConfigLogDB("logdb.yaml")
tt.ConfigQueue("queue.yaml")