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

5m5v-bot

v1.5.1

Published

Twitter Bot That Retweets People Who Are Considering Veganism

Downloads

50

Readme

5M5V Bot

Fork from plorry/VegAssist to retweet people looking for support going vegan for 5 Minutes 5 Vegans. https://5minutes5vegans.org

This bot tracks usage of the term "vegan" - and its translated variants depending on the config - on Twitter's public stream, and processes each item, looking for exact matches on an array of preset phrases. This bot can be setup for multiple authorised accounts for the same app, retweeting messages matching only certain filters to only certain accounts.

Implements full verification of all supplied API credentials, to avoid potential headaches.

API Credentials

Visit https://developer.twitter.com/apps to register your own app and obtain the credentials to use. To register more users under your app, visit https://5minutes5vegans.org/twitteroauth to grant permission and obtain their access tokens.

Installing

Yarn

  1. Run yarn add 5m5v-bot to install the bot to your project
  2. Copy the 5m5v-config.example.yaml file in node_modules/5m5v-bot into your own project under 5m5v-config.yaml and configure the bot
  3. Run yarn 5m5v-bot in the directory of your project to run the bot

You can install the bot globally to your system with yarn global add 5m5v-bot instead. From then you can run yarn 5m5v-bot from any folder, as long as it contains a config file.

Manual

  1. Clone this repository
  2. Run yarn install in the directory that you cloned this repository into
  3. Copy the 5m5v-config.example.yaml file to your own 5m5v-config.yaml and configure the bot
  4. Run node . in the directory of the repository to run the bot

Configuration

The configuration is loaded from 5m5v-config.yaml in the working directory, which is likely either the directory of your cloned repository or the directory of your project where you installed the node package. The configuration format is YAML, with its options listed below.

consumer_key

You find this in your app on Twitter under "Keys and tokens" -> "Consumer API keys". It's listed as "API key".

consumer_secret

Underneath the previous key, listed as "API secret key".

users

A list containing all users to retweet with. The first user listed will be used to listen to the Twitter stream with.

users.access_token

  • Available for your developer account underneath the last two keys under "Access token & access token secret". It's listed as "Access token".
  • For other accounts this is the oauth_token, obtainable at either https://5minutes5vegans.org/twitteroauth or your own OAuth implementation.

users.access_token_secret

  • Available for your developer account underneath the previous key, listed as "Access token secret".
  • For other accounts this is the oauth_token_secret, obtainable at either https://5minutes5vegans.org/twitteroauth or your own OAuth implementation.

users.filters

A list of filters that this user will be retweeting matches from.

exclude (optional)

A list of keywords that if found in a Tweet will exclude that Tweet from being retweeted.

delaytime (optional)

The time to delay retweets with once a matching Tweet has been found. Defaults to two minutes.

Running the tests

Simply run yarn test

Disabling retweets

Retweets can be disabled for testing purposes by using the argument --dry-run, e.g. node . --dry-run. In dry run mode, matching tweets will be logged to the console but not retweeted.