diff --git a/disqus.go b/disqus.go index b40c05f..8a932df 100644 --- a/disqus.go +++ b/disqus.go @@ -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) diff --git a/disqus_test.go b/disqus_test.go index f5d9a3f..eeb3622 100644 --- a/disqus_test.go +++ b/disqus_test.go @@ -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") +} diff --git a/front.go b/front.go index 130fa30..211f28b 100644 --- a/front.go +++ b/front.go @@ -338,6 +338,7 @@ func HandleDisqusCreate(c *gin.Context) { Thread: thread, AuthorEmail: email, AuthorName: name, + Identifier: identifier, IpAddress: c.ClientIP(), }