Jelajahi Sumber

新增配置

maxiaoshan 2 tahun lalu
induk
melakukan
9a0cf3d18c
3 mengubah file dengan 11 tambahan dan 3 penghapusan
  1. 9 0
      src/spiderutil/sysconfig.go
  2. 1 1
      src/spiderutil/template.go
  3. 1 2
      src/spiderutil/util.go

+ 9 - 0
src/spiderutil/sysconfig.go

@@ -20,6 +20,7 @@ type config struct {
 	MsgserveraddrFile string                     `json:"msgserveraddrfile"`
 	Editoraddr        string                     `json:"editoraddr"`
 	Tesseractadd      string                     `json:"tesseractadd"`
+	BidEditor         dbInfo                     `json:"bideditor"`
 	Testdir           string                     `json:"testdir"`
 	Uploadevent       int                        `json:"uploadevent"`
 	Redistype         string                     `json:"redistype"`
@@ -95,4 +96,12 @@ type config struct {
 	TimeOut           time.Duration `json:"timeout"`
 }
 
+type dbInfo struct {
+	Addr     string
+	Db       string
+	Size     int
+	Username string
+	Password string
+}
+
 var Config config

+ 1 - 1
src/spiderutil/template.go

@@ -96,7 +96,7 @@ function downloadDetailPage(data)
 	for i=1,3 do 	--3次下载任务不成功,退出
 		local content = download(data["href"],{})
 		
-		data["s_title"]=""
+		data["s_title"]=com.trim(findOneText("",content))
 		data["detail"]=findContentText("%s",content)
 		data["contenthtml"]=findOneHtml("%s",content)
 		data["l_np_publishtime"]=com.strToTimestamp(data["publishtime"])

+ 1 - 2
src/spiderutil/util.go

@@ -7,13 +7,12 @@ import (
 	"encoding/hex"
 	"encoding/json"
 	"fmt"
+	"github.com/yuin/gopher-lua"
 	"math/rand"
 	"net/http"
 	"os"
 	"qfw/util"
 	"time"
-
-	"github.com/yuin/gopher-lua"
 )
 
 //time.AfterFunc 加锁