{"id":21597403,"url":"https://github.com/cleantalk/csharp-antispam","last_synced_at":"2025-04-11T00:52:38.255Z","repository":{"id":47931686,"uuid":"13249366","full_name":"CleanTalk/csharp-antispam","owner":"CleanTalk","description":"CleanTalk service API for C#","archived":false,"fork":false,"pushed_at":"2024-03-24T13:30:54.000Z","size":8667,"stargazers_count":17,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-11T00:52:34.378Z","etag":null,"topics":["anti-spam","antispam","csharp","csharp-antispam","spam","spam-protection"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleanTalk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-10-01T16:37:18.000Z","updated_at":"2024-11-22T12:03:26.000Z","dependencies_parsed_at":"2023-02-09T10:31:08.952Z","dependency_job_id":"42e40ddd-fd81-49c3-a691-c5817c07ec8c","html_url":"https://github.com/CleanTalk/csharp-antispam","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fcsharp-antispam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fcsharp-antispam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fcsharp-antispam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fcsharp-antispam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanTalk","download_url":"https://codeload.github.com/CleanTalk/csharp-antispam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322610,"owners_count":21084336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anti-spam","antispam","csharp","csharp-antispam","spam","spam-protection"],"created_at":"2024-11-24T18:08:56.238Z","updated_at":"2025-04-11T00:52:38.235Z","avatar_url":"https://github.com/CleanTalk.png","language":"C#","readme":"csharp-antispam\r\n===============\r\n\r\nCleanTalk service API for C#. It is invisible protection from spam, no captchas, no puzzles, no animals, and no math.\r\n\r\n## Actual API documentation\r\n\r\n* [check_message](https://cleantalk.org/help/api-check-message) - Check IPs, Emails and messages for spam activity\r\n* [check_newuser](https://cleantalk.org/help/api-check-newuser) - Check registrations of new users\r\n* [spam_check](https://cleantalk.org/help/api-spam-check) - This method should be used for bulk checks of IP, Email for spam activity\r\n* [ip_info](https://cleantalk.org/help/api-ip-info-country-code) - method returns a 2-letter country code (US, UK, CN, etc.) for an IP address\r\n\r\n## How does the API stop spam?\r\n\r\nThe API uses several simple tests to stop spammers.\r\n* Spambot signatures.\r\n* Blacklist checks by Email, IP, website domain names.\r\n* Javascript availability.\r\n* Comment submit time.\r\n* Relevance test for the comment.\r\n\r\n## How does the API work?\r\n\r\nAPI sends the comment's text and several previous approved comments to the server. The server evaluates the relevance of the comment's text on the topic, tests for spam and finally provides a solution - to publish or to put in manual moderation queue of comments. If a comment is placed in manual moderation queue, the plugin adds a rejection explanation to the text of the comment.\r\n\r\n## Requirements\r\n\r\n* [.Net Framework v4.8](https://dotnet.microsoft.com/download/dotnet-framework)\r\n* CleanTalk account https://cleantalk.org/register?product=anti-spam\r\n\r\n\r\n## SPAM test examples\r\n\r\n### Usage of check_message method for text comment verify\r\n\r\n```c#\r\n\r\npublic const string AuthKey = \"auth key\";\r\n\r\n//...\r\nvar req1 = new CleantalkRequest(AuthKey)\r\n{\r\n    Message = \"This is a great storm!\",\r\n    SenderInfo = new SenderInfo\r\n    {\r\n        Refferrer = \"https://www.bbc.co.uk/sport\",\r\n        UserAgent = \"Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.12\"\r\n    },\r\n    SenderIp = \"91.207.4.192\",\r\n    SenderEmail = \"keanu8dh@gmail.com\",\r\n    SenderNickname = \"Mike\",\r\n    EventToken = \"f32f32f32f32f32f32f32f32f32f32a2\",\r\n    ///     To get this param:\r\n    ///         1. add a script to the web-page: \u003cscript src=\"https://moderate.cleantalk.org/ct-bot-detector-wrapper.js\" id=\"ct_bot_detector-js\"\u003e\u003c/script\u003e\r\n    ///         2. parse the newly added hidden input on the web form, the name atrribute of input is \"ct_bot_detector_event_token\" \r\n    ///     @var string\r\n    SubmitTime = 15\r\n};\r\n\r\nvar res1 = _cleantalk.CheckMessage(req1);\r\n\r\n```\r\nAPI returns response object:\r\n  * allow (0|1) - allow to publish or not, in other words spam or ham.\r\n  * comment (string) - server comment for requests.\r\n  * id (string MD5 HEX hash) - unique request idenifier.\r\n  * errno (int) - error number. errno will be 0 if request is successful.\r\n  * errtstr (string) - comment explaining the error. errstr will be `null` if request is successful.\r\n  \r\n\r\n### Usage of spam_check method for bulk parameters\r\n\r\n```c#\r\npublic const string SpamCheckAuthKey = \"spam_check auth key\";\r\n\r\n//...\r\nvar req1 = new SpamCheckRequest(SpamCheckAuthKey)\r\n{\r\n    data = \"stop_email@example.com,10.0.0.1,10.0.0.2\"\r\n};\r\nvar res1 = _cleantalk.SpamCheck(req1);\r\n```\r\nResult:\r\n```json\r\n{\r\n  \"data\":\r\n  {\r\n    \"stop_email@example.com\":{\r\n      \"appears\":true,\r\n      \"disposable_email\":false,\r\n      \"sha256\":\"6d42ca0235d72b01a2b086ad53b5cfac24b5a444847fad70250e042d7ca8bf59\",\r\n      \"spam_rate\":0,\r\n      \"submitted\":\"2023-09-06 07:20:49\",\r\n      \"updated\":\"2023-09-06 07:20:49\"\r\n      },\r\n    \"10.0.0.1\":{\r\n      \"domains_count\":1510,\r\n      \"frequency\":2,\r\n      \"network_type\":\"hosting\",\r\n      \"sha256\":\"f5047344122f0dee9974ba6761e61c6b8649e1f3968d13a635ebbf7be53a3a0d\",\r\n      \"spam_rate\":0,\r\n      \"submitted\":\"2020-06-19 09:57:46\",\r\n      \"updated\":\"2023-11-01 18:58:11\"\r\n      },\r\n    \"10.0.0.2\":{\r\n      \"domains_count\":35,\r\n      \"frequency\":1,\r\n      \"network_type\":\"hosting\",\r\n      \"sha256\":\"cb5f37b4762871e6bbeccee663cb332438340c469160c634566ecc7c7e01009f\",\r\n      \"spam_rate\":0,\r\n      \"submitted\":\"2022-01-18 19:58:09\",\r\n      \"updated\":\"2023-07-19 18:58:13\"\r\n      }\r\n  }\r\n}\r\n```\r\n\r\n\r\n### Usage of ip_info method for detecting county 2-letter code\r\n\r\n```c#\r\npublic const string AuthKey = \"auth key\";\r\n\r\n//...\r\nvar res1 = _cleantalk.IpInfoCheck(AuthKey, \"8.8.8.8\", \"213.239.245.253\", \"109.191.240.212\");\r\n \r\n```\r\nResult:\r\n```json\r\n{\r\n  \"data\":\r\n  {\r\n    \"8.8.8.8\":{\"country_code\":\"US\",\"country_name\":\"United States\"},\r\n    \"213.239.245.253\":{\"country_code\":\"DE\",\"country_name\":\"Germany\"},\r\n    \"109.191.240.212\":{\"country_code\":\"RU\",\"country_name\":\"Russian Federation\"}\r\n  }\r\n}\r\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleantalk%2Fcsharp-antispam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleantalk%2Fcsharp-antispam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleantalk%2Fcsharp-antispam/lists"}