1.0.2 • Published 6 years ago

homophobia.js v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

homophobia.js

Status

Build Status npm version

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:

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:

  1. Get your ipdata API key. Otherwise, there's a default key that may or may not work.
  2. 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...

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago