npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wtf-plugin-nsfw

v0.1.0

Published

content filter for wikipedia articles

Downloads

35

Readme

This plugin is a (work in progress) attempt to filter objectionable, or adult content, in various forms, in wikipedia.

Wikipedia has frequently rejected any explicit rating system, or content flagging, due to fears that it will be misused, or generate dispute.

As a result, there is a large amount of graphic imagery, pornography, detailed violence, drug use, and other nsfw content, without any clear-cut way to identify it. 1

This library tries to flag an article as nsfw, according to some structured information, and some opinionated (but sensible) rules.

It looks in a number of different places:

  • categories (like '[[Category:Machine Guns]]')
  • templates (like {{Sex positions}})
  • page titles (like star wars (Adult Film))
  • pages with images from Wikipedia's bad image list
const wtf = require('wtf_wikipedia')
wtf.extend(require('wtf-plugin-sfw'))

let doc = await wtf.fetch('One-night stand')
let res = doc.nsfw()
//{
//  safe_for_work: false,
//  reason: 'Sexuality',
//  detail: {template: [{name:'human sexuality']}
//}

let doc = await wtf.fetch('Toronto Raptors')
let res = doc.sfw()
//{
//  safe_for_work: true,
//  reason:null
//  detail: {}
//}

The reason property may be one of Sexuality|Drug-use|Weapons|Violence|Profanity

As of v0.1, this library flags ~2% of english wikipedia articles.

Notes:

In general, sexual content is flagged in a general way - without any judgement or consideration of morality or taste. This could include content that most find harmless, like books with LGBT characters, or medical information about sexual body parts.

Explicit recreational drug information is flagged, along with some (often helpful) medical information.

Weapon content of all kinds is attempted to be flagged. This includes historical, and fictional weaponry.

Wars and military conflicts are kept, but an attempt is made to limit pages with grotesque violent acts. (particularly difficult)

This library is very limited right now, and is certainly not appropriate for any commercial or wide-spread usage.

You're free to use the information provided by this library however you wish. You may choose to establish your own rules.

This library is built for the english wikipedia, and other languages are not supported.

Disclaimer

This script is not intended to be used as a sufficient content-filter for any content, in wikipedia or elsewhere. Additional care needs to be taken, in addition to this script, to ensure content meets any content guidelines, or that it is safe for a general audiance.

The authors and contributors take no responsibility for the performance or accuracy of this script.

work-in-progress!

MIT