{"id":18707587,"url":"https://github.com/discourse/discourse-perspective-api","last_synced_at":"2025-08-10T22:32:43.846Z","repository":{"id":32092254,"uuid":"118462841","full_name":"discourse/discourse-perspective-api","owner":"discourse","description":"Google Perspective API Plugin for Discourse","archived":false,"fork":false,"pushed_at":"2025-06-21T15:47:05.000Z","size":772,"stargazers_count":18,"open_issues_count":0,"forks_count":9,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-06-21T16:34:49.620Z","etag":null,"topics":["discourse","discourse-plugin","perspective-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discourse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-22T13:46:27.000Z","updated_at":"2025-06-21T15:47:07.000Z","dependencies_parsed_at":"2023-11-13T01:27:29.928Z","dependency_job_id":"0a80ee0b-fd3b-47f6-b73e-489f3eaeeab0","html_url":"https://github.com/discourse/discourse-perspective-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/discourse/discourse-perspective-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-perspective-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-perspective-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-perspective-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-perspective-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discourse","download_url":"https://codeload.github.com/discourse/discourse-perspective-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-perspective-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269799252,"owners_count":24477630,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discourse","discourse-plugin","perspective-api"],"created_at":"2024-11-07T12:18:59.345Z","updated_at":"2025-08-10T22:32:43.823Z","avatar_url":"https://github.com/discourse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discourse Perspective plugin\n\nhttps://meta.discourse.org/t/google-perspective-api-plugin/98733\n\nThis plugin flags toxic posts using Google's Perspective API.\n\n## Installation\n\nFollow the directions at [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/19157) using https://github.com/discourse/discourse-perspective-api.git as the repository URL.\n\n## Authors\n\nErick Guan\n\n## License\n\nGNU GPL v2\n\n## Data Explorer Queries\n\nIf you choose standard mode, use `post_perspective_toxicity`. Otherwise, replace them to `post_perspective_severe_toxicity`. For most toxic categories and users, I choose a\nprobability 0.85 as the threshold.\n\nMost toxic categories:\n\n```sql\nSELECT COUNT(pc) as counts, c.id, c.name, c.description\nFROM post_custom_fields pc\nJOIN posts p ON p.id = pc.post_id\nJOIN topics t ON t.id = p.topic_id\nJOIN categories c ON c.id = t.category_id\nWHERE pc.name = 'post_perspective_toxicity' AND pc.value \u003e= '0.85'\nGROUP BY c.id\nORDER BY counts DESC\nLIMIT 100\n```\n\nMost toxic users:\n\n```sql\nSELECT COUNT(pc) as counts, u.id, u.username, u.trust_level, u.suspended_till, u.silenced_till\nFROM post_custom_fields pc\nJOIN posts p ON p.id = pc.post_id\nJOIN users u ON p.user_id = u.id\nWHERE pc.name = 'post_perspective_toxicity' AND pc.value \u003e= '0.85'\nGROUP BY u.id\nORDER BY counts DESC\nLIMIT 100\n```\n\nMost toxic posts:\n\n```sql\nSELECT p.id, pc.value, p.user_id, p.topic_id, p.created_at, p.raw\nFROM post_custom_fields pc\nJOIN posts p ON p.id = pc.post_id\nWHERE pc.name = 'post_perspective_toxicity'\nORDER BY pc.value DESC\nLIMIT 100\n```\n\nMost toxic posts today:\n\n```sql\nSELECT p.id, pc.value, p.user_id, p.topic_id, p.created_at, p.raw\nFROM post_custom_fields pc\nJOIN posts p ON p.id = pc.post_id\nWHERE pc.name = 'post_perspective_toxicity' AND\np.created_at \u003e= CURRENT_DATE\nORDER BY pc.value DESC\nLIMIT 100\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-perspective-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscourse%2Fdiscourse-perspective-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-perspective-api/lists"}