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

glamour-redditbot

v1.1.1

Published

A procedurally generating natural language Reddit bot capable of acting on a variety of triggers such as comment sentiment, emotion, and phrases

Downloads

13

Readme

glamour

A procedurally generating natural language Reddit bot capable of acting on a variety of triggers such as comment sentiment, emotion, and phrases

Requirements

  • Reddit API and User
  • Tested on NodeJS v11.15.0, may work on other versions
  • Only tested on Linux, should work on Windows

Installation

In a CMD/terminal,

npm install glamour-redditbot

Modify the configs in ./config and then start the bot with,

npm start

Configuration

config.json

{
  // The following two sections shouldn't need instructions
  "redditCredentials": {
    "appID": "",
    "appSecret": "",
    "userAgent": "Glamour/{version} by Charisma",
    "username": "",
    "password": ""
  },
  // This is on by default and is very verbose. It doesn't post comments and gives emotional/sentiment read outs
  "debugMode": true
}

replies.json

{
  // You can have multiple replies per bot.
  "replies": [
    {
      "name": "I Love Kitties",
      "replyDelay": 1, // How long after a comment until the bot replies in minutes
      "delayFuzz": 60, // A random amount of seconds up to the provided number added to the delay
      "cooldown": 5, // Minutes until the reply will trigger again, this skips detected comments until it is off cooldown
      "subreddits": [ // Subreddits this post in
        "cats"
      ],
      "bannedSubreddits": [ // Subreddits this wont post in
        "dogs",
        "puppies"
      ],
      "bannedUsers": [ // Users this wont reply to
        "automoderator"
      ],
      "detailCount": 2, // How many unique details to use
      "typos": true, // Add in typos
      "oncePerUser": true, // Only reply to a user once, ever
      "oncePerSubmission": true, // Only reply to a submission once, ever
      "prefaces": [ // First sentrance, 1 chosen randomly
        "I {love|adore|go bonkers for} kitties too!", // Words spereated with | within {} will have one chosen randomly
        "There is nothing I {adore|love} more than kitties!"
      ],
      "details": [ // Supporting details, chosen randomly
        "They are SOOOO cuddly!",
        "They are so warm and soft!",
        "They are just great!"
      ],
      "conclusions": [ // Closing sentance, chosen randomly
        "I just love them so much!",
        "OoOoO, I just can't help my self"
      ],
      "triggers": [ // These all need to be true for the reply to be used
        {
          "type": "sentiment",
          "value": "notNegative", // Can be positive, negative, neutral, notPositive, and notNegative
          "overrides": { // Overrides for words and their values, -5 to 5
            "kitties": 5
          }
        },
        {
          "type": "phrase", // Word search
          "included": true, // true or false. Must include or must not include ONE of the phrases
          "phrases": [
            "kitty",
            "kittens",
            "cat",
            "cute"
          ]
        },
        {
          "type": "phrase",
          "included": false,
          "phrases": [
            "puppy",
            "puppies"
          ]
        },
        {
          "type": "emotion",
          "emotion": "anger", // Possible emotions are bellow. Vulnerability is 0-5, emotions are probabilities 0.0-1.0
          "value": 0 // If 0, must be 0 or not this emotion, anything over 0 requires the value to be >= to it
        }
      ]
    }
  ]
}

Possible Emotions

joy
worry
sadness
anger
friendly
delight
disgust
fear
courage
surprise
calm
depression
danger
relief
neutral
vulnerable

subreddits.json

{
  "subreddits": [
    {
      "name": "cats", // The sub
      "cooldown": 11, // Mintues between replies, will still eventually reply to comments heard during the cooldown
      "pollTime": 5, // Time in seconds to look for new comments
      "results": 50 // Results per poll
    }
  ]
}

typos.json

{
  "typos": {
    "typoRate": 100, // The rate typos are introduce in 10ths of a percent. 1 = 0.1%, 10 = 1%, 100 = 10%
    "typoCommas": true, // Forget to use commas
    "typoApostrophes": true, // Forget to use Apostrophes
    "typoCase": true, // Forget casing
    "speechParts": [
      {
        "string": "they're", // The speech part to misspell
        "typos": [ // The possible typos, chosen at random
          "theyre",
          "there",
          "their"
        ]
      },
      {
        "string": "theyre",
        "typos": [
          "there",
          "their"
        ]
      },
      {
        "string": "their",
        "typos": [
          "there",
          "theyre"
        ]
      },
      {
        "string": "there",
        "typos": [
          "theyre",
          "their"
        ]
      },
      {
        "string": "your",
        "typos": [
          "youre"
        ]
      },
      {
        "string": "youre",
        "typos": [
          "your"
        ]
      },
      {
        "string": "you're",
        "typos": [
          "your"
        ]
      },
      {
        "string": "you",
        "typos": [
          "u"
        ]
      },
      {
        "string": "ei",
        "typos": [
          "ie",
          "ee"
        ]
      },
      {
        "string": "ie",
        "typos": [
          "ee",
          "ei"
        ]
      },
      {
        "string": "ai",
        "typos": [
          "ia"
        ]
      },
      {
        "string": "ia",
        "typos": [
          "ai"
        ]
      },
      {
        "string": "qu",
        "typos": [
          "q"
        ]
      }
    ]
  }
}

Disclaimer

I'm not responsible for what this bot is used for, or the consequences thereof. It is a powerful tool that can be used to do many great, or terrible things. Use common sense.