Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including twaffle with all npm packages installed. Try it out:

var twaffle = require("twaffle")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

twaffle v0.0.2

A TWitter rAFFLE script


 _                  __  __ _
| |                / _|/ _| |
| |___      ____ _| |_| |_| | ___
| __\ \ /\ / / _' |  _|  _| |/ _ \
| |_ \ V  V / (_| | | | | | |  __/
 \__| \_/\_/ \__,_|_| |_| |_|\___|

A TWitter rAFFLE script.

CircleCI npm version

Twaffle allows you to extract random tweets for a set of keywords. It's ideal to do raffles over tweeter: get some people to tweet some specific keywords and then extract an arbitrary number of random winners!


npm install --global twaffle

Or you can use it with npx (see usage), so in such case you don't have to install it at all.

Finally, you can also use the compiled binaries distributed for the major operative systems.


To use Twaffle you would need to access to the Twitter developer platform and have obtained keys for an app.

Once you got your keys, make sure that they are exported as environment variables in the local shell:


Note: Twitter keys can also be passed as arguments, see twaffle --help for more details.

At this point you can run twaffle as in the following example:

twaffle --keywords '#oredev again' --winners=3

this will extract 3 random tweets that have the keywords #oredev and again.

If you didn't install twaffle and you have a recent version of NPM you can simply run twaffle through npx:

npx twaffle --keywords '#oredev again' --winners=3

Bugs and improvements

If you find a bug or have an idea about how to improve Twaffle you can open an issue or submit a pull request, it will definitely make you a better person! 😇


Licensed under MIT License. © Luciano Mammino.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free