MyNixOS website logo
Description

JSON HTTP interface to Eros.

This is a small program that runs an HTTP server.

Changelog

0.6.0.1

Remove unneeded dependency on wai-responsible.

0.6

Update to be compatible with Eros v.0.6

eros-http

This is an HTTP front-end to the Eros library. Eros is a text censorship library, that I wrote.

Usage

If the server receives a GET request, it returns an HTML representation of this file.

It takes an input string via POST, and returns some data in JSON mapping each phraselist to the score for the input string. The JSON is compressed.

I fed the server the GPL, here are the results, which have been prettified, and alphabetized by key.

{
  "chat": 0,
  "conspiracy": 0,
  "drug-advocacy": 0,
  "forums": 0,
  "gambling": 0,
  "games": 0,
  "gore": 0,
  "id-theft": 0,
  "illegal-drugs": 0,
  "intolerance": 0,
  "legal-drugs": 0,
  "malware": 0,
  "music": 0,
  "news": 0,
  "nudism": 0,
  "peer2peer": 0,
  "personals": 0,
  "pornography": 20,
  "proxies": 0,
  "secret-societies": 0,
  "self-labeling": 0,
  "sport": 30,
  "translation": 0,
  "upstream-filter": 0,
  "violence": 0,
  "warez-hacking": 0,
  "weapons": 0,
  "webmail": 0
}

The home page of PornHub yields this result:

{
  "chat": 0,
  "conspiracy": 0,
  "drug-advocacy": 0,
  "forums": 0,
  "gambling": 0,
  "games": 0,
  "gore": 0,
  "id-theft": 0,
  "illegal-drugs": 0,
  "intolerance": 0,
  "legal-drugs": 0,
  "malware": 0,
  "music": 0,
  "news": 0,
  "nudism": 0,
  "peer2peer": 0,
  "personals": 0,
  "pornography": 8790,
  "proxies": 0,
  "secret-societies": 0,
  "self-labeling": 0,
  "sport": 0,
  "translation": 0,
  "upstream-filter": 0,
  "violence": 0,
  "warez-hacking": 0,
  "weapons": 0,
  "webmail": 0
}

This is the command I used

curl www.pornhub.com | curl -d @- localhost:8000 | prettify.rb

This uses my JSON prettifier script.

Overflow bug

Edit - This bug was fixed in version 0.6.

There's a fundamental flaw in the algorithm where if it gets a lot of data witha lot of flagged phrases, it takes a long time to calculate the result. Theserver times out after 30 seconds. I haven't figured out how to getmultiprocessing, so this will remain a bug until I do.

This won't be a problem for typical usage, only if you try to send paragraphs ofdirty data in one string.

Typical usage is for SMS messages, which are at most 160 characters long.

Metadata

Version

0.6.0.1

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows