DEV Community

Robert James Gabriel
Robert James Gabriel

Posted on • Edited on

A node module that returns an array of Bad Words and Top Swear Words Banned by Google.

Google has inadvertently created an API that third-party developers can use to check whether a word entered by a user is likely to be offensive or not. This is now closed and was part of the Googles What Do You Love? site. So I scrapped this before it was closed and its now in a node module for people to use in projects. Hope you enjoy!!

Installation

$ npm install --save google-profanity-words
Enter fullscreen mode Exit fullscreen mode

Usage

const googleProfanityWords = require('google-profanity-words');

googleProfanityWords.list(); //  [ '5h1t','5hit','a55','anal','anus',etc.....]  Returns a array of Profanity. 350

Enter fullscreen mode Exit fullscreen mode

You can follow me on here and on the following for more code and projects.

Top comments (10)

Collapse
 
joelnet profile image
JavaScript Joel

I'd love to see a script that would transform my source code variables into words from this list.

Collapse
 
vberlier profile image
Valentin Berlier

inb4 babel-plugin-profanity

Collapse
 
joelnet profile image
JavaScript Joel

lol. I actually checked npm to see if this package exists!

Collapse
 
moopet profile image
Ben Sinclair

I'm wondering why some of those patterns have whitespace at the end. Is that how they came from Google or is it an artifact of your scraping process? Matching would fail if a sentence ended in something like (ahem) "listplucking."

I'm terribly unfond of these sorts of measures though in general :)

Collapse
 
lysofdev profile image
Esteban Hernández

This is great! I've been working on a Google Chrome plugin that removes profanity from web pages. My grandmother felt strongly about the issue.

Collapse
 
coajaxial profile image
Fluttershy

That's why bobs and vegana has become a meme: It's not in the list. :'D

Collapse
 
kurisutofu profile image
kurisutofu

How does that work?
Is that list being updated when google adds a new word to their swear list or is it static?

Collapse
 
gsto profile image
Glenn Stovall

It returns an array, stored in plain text: github.com/RobertJGabriel/google-p...

Collapse
 
fergek profile image
Fernando Gekdyszman

Is it a parse-and-lookup for words or does it analyze natural language and sentence semantics?

Collapse
 
jacobtstaggs profile image
Jacob Staggs

Nice, did not know this was a thing and will be good for sites with public chat. Thanks for sharing