File: doc.go

package info (click to toggle)
golang-github-adtac-go-akismet 0.0~git20181220.0ca9e10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 104 kB
  • sloc: makefile: 2
file content (33 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
The akismet package provides a client for using the Akismet API.

Usage:

	import "github.com/adtac/go-akismet/akismet"

Here's an example if you want to check whether a particular comment is spam or
not using the akismet.Check method:

	akismetKey := "abcdef012345"
	isSpam, err := akismet.Check(akismet.Comment{
		Blog: "https://example.com",                 // required
		UserIP: "8.8.8.8",                           // required
		UserAgent: "...",                            // required
		CommentType: "comment",
		CommentAuthor: "Billie Joe",
		CommentAuthorEmail: "billie@example.com",
		CommentContent: "Something's on my mind",
	}, akismetKey)

	if err != nil {
		// There was some issue with the API request. Most probable cause is
		// missing required fields.
	}

You can also submit false positives (comments that were wrongly marked as spam)
with the akismet.SubmitHam method. Or you can submit false negatives (comments
that should be marked as spam, but weren't) with the akismet.SubmitSpam method.
Both methods have the same method signature as the akismet.Check function: an
akismet.Comment structure as the first argument followed by your API key.
*/
package akismet