This commit is contained in:
deepzz0
2017-01-08 15:59:47 +08:00
parent 777dd86357
commit e626df3c22
3 changed files with 17 additions and 1 deletions

View File

@@ -159,7 +159,6 @@ func PostComment(pc *PostCreate) string {
return ""
}
request.Header.Set("Referer", "https://disqus.com")
logd.Print(*request)
resp, err := http.DefaultClient.Do(request)
if err != nil {
logd.Error(err)

View File

@@ -7,3 +7,19 @@ import (
func TestDisqus(t *testing.T) {
PostsCount()
}
func TestPostComment(t *testing.T) {
pc := &PostCreate{
Message: "hahahaha",
Thread: "52799014",
AuthorEmail: "deepzz.qi@gmail.com",
AuthorName: "deepzz",
}
id := PostComment(pc)
if id == "" {
t.Error("post failed")
return
}
t.Log("post success")
}

View File

@@ -338,6 +338,7 @@ func HandleDisqusCreate(c *gin.Context) {
Thread: thread,
AuthorEmail: email,
AuthorName: name,
Identifier: identifier,
IpAddress: c.ClientIP(),
}