homophobia.js v1.0.2
homophobia.js
Status
What is homophobia.js?
homophobia.js is a library that helps you automate censorship of LGBT content in countries that have laws against it.
Example use cases:
- Replacing all lgbt content with praise to the glorious leader Putin
- Disabling custom pride themed watch faces in certain countries
- All other kind of censorship you can dream of
Installation
npm install homophobia.js
- Or use yarn if you're a cool kid.
- If you don't know what that means, too bad.
Usage
Basic
Using ES6 import because even homophobic people are civilised:
import { Homophobia } from 'homophobia.js';
const homophobia = new Homophobia();
// The library will use navigator.language to detect the country
const homophobic = homophobia.isHomophobic;
The isHomophobic
property will be true if the user is in a country with LGBT censorship.
Geo detection
If you want more precise detection, you can use a geo API to detect the user's country from their IP:
- Get your ipdata API key. Otherwise, there's a default key that may or may not work.
- Use the following code:
// If you want something more precise, you
homophobia.setGeoApiKey('MY_API_KEY');
homophobia.geoDetection().then((isHomophobic) => {
// Censor things if isHomophobic is true, for example delete all rainbows.
});
TypeScript
This is written in TypeScript, so it includes type defs (I know you don't care).
FAQ
How does it work?
It detects the country code, and will consider the country homophobic if laws that censor LGBT content exist. (I've only put Russia in the list for now though)
How do I contribute?
Really, don't you have anything better to do with your time?
Can I use this unironically?
Technically you can, I guess...