Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

clean-this-tweet-up

1.0.2 • Public • Published

clean-this-tweet-up

given a tweet, return the text of that tweet with all #s, usernames, phone-numbers, addresses, emails, and urls removed. you know, so that you aren't messing up someone's twitter neighbourhood by letting your bot spam up their stuff all the time.

NOTE: regexes are not a matter of fact!

You should not 100% depend on this module to sanitize everything. In fact, you should expect it to probably fail while trying to do so and return garbled input. The best strategy is to keep an eye on your robots and the inputs they are consuming and be prepared to swiftly delete their output if necessary

NPM Build Status

npm install clean-this-tweet-up --save 

var cleanThisTweet = require('clean-this-tweet-up')

var tweet = // acquire a tweet object from the twitter blobs somehow. perhaps engage with a brand to win favor with the twitter glob. we all have different strategies here, just do what you do.

var text = cleanThisTweet(tweet)

// now you can doo something with that text, and know its probably not gonna blow up someones spot or RTing some dox! oh but be sure to use a module like wordfilter or iscool to check the text too because twitter is a filthy place. kbye!

This module is designed to be used with the ttezel/twit module, but will accept any tweet object that conforms to this interface

Keywords

install

npm i clean-this-tweet-up

Downloadsweekly downloads

1

version

1.0.2

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar