This commit is contained in:
eson 2018-12-20 01:31:26 +08:00
parent 2f570bbc82
commit e66254e37c

View File

@ -2,6 +2,8 @@ package parser
import ( import (
"encoding/json" "encoding/json"
"log"
"strconv"
"testing" "testing"
) )
@ -24,6 +26,16 @@ func (tt *Toutiao) GetSpiderID() int {
} }
func (tt *Toutiao) ToDoParser(adstring string) (string, error) { func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
log.Println(adstring)
adstring = strconv.QuoteToASCII(adstring)
var addata map[string]interface{}
if err := json.Unmarshal([]byte(adstring), &addata); err != nil {
log.Println(err)
}
log.Println(addata)
adparser := NewADParser(tt.GetSpiderID()) adparser := NewADParser(tt.GetSpiderID())
data, err := adparser.ToJSON() data, err := adparser.ToJSON()
if err != nil { if err != nil {