# loljs-bot

> Automating the task of /r/loljs on /r/programmerhumor

Latest version **1.0.0** (published 2017-03-29) · WTFPL license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install loljs-bot
pnpm add loljs-bot
yarn add loljs-bot
bun add loljs-bot
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-03-29 |
| First published | 2017-03-29 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | /u/DeeSnow97 |
| Maintainers | b3nsn0w |

## Links

- npm: https://www.npmjs.com/package/loljs-bot
- Repository: https://github.com/DeeSnow97/loljs-bot
- Homepage: https://github.com/DeeSnow97/loljs-bot#readme
- Issues: https://github.com/DeeSnow97/loljs-bot/issues
- npm.io page: https://npm.io/package/loljs-bot

## Dependencies (3)

- [dotenv](https://npm.io/package/dotenv.md) ^4.0.0
- [yamljs](https://npm.io/package/yamljs.md) ^0.2.8
- [snoowrap](https://npm.io/package/snoowrap.md) ^1.12.0

## Recent versions

- 1.0.0 (latest) — 2017-03-29

## README

loljs-bot is a Reddit bot to automate the "lol, JavaScript" style posts in [/r/programmerhumor](https://reddit.com/r/programmerhumor). On default settings, it takes a random post from [/r/loljs](https://reddit.com/r/loljs) every day and reposts it without modifications, crediting the original poster in a comment.

# Running the bot yourself

First, download the source code

    $ git clone https://github.com/DeeSnow97/loljs-bot

Then configure the environment variables. You can set them through usual ways or use a .env file. If you choose the latter, it should look something like this:

    # Reddit credentials

    REDDIT_CLIENT_ID=seriousbot007
    REDDIT_CLIENT_SECRET=iLikePaamayimNekudotayim
    REDDIT_USERNAME=loljs-bot
    REDDIT_PASSWORD=[object Object] # just kidding, it cannot contain spaces

    # Uncomment this line to change the posting interval
    # POST_INTERVAL=86400000

Then just run the bot however long you want to

    $ node loljs-bot

# Advanced Usage

Currently, loljs-bot exposes one function on the public interface:

* ## `repost(source = 'loljs', target = 'programmerhumor')`

  Takes a random post from the source subreddit and reposts it in the target.

  Usage:

  ```javascript
  const {repost} = require('loljs-bot')

  repost('lolphp', 'programmerhumor') // the same thing as the original bot, but with lolphp
  ```

However, if you like hacking, you can do stuff like `require('loljs-bot/randompost')` to access intermediate states (randompost for example loads and prepares a random post, but doesn't repost it).

# Message of the Day

loljs-bot has a (severely lacking) set of "message of the day" strings in messages.yaml. Feel free to contribute to that, but please make separate pull requests for each line in case moderation happens in the future.

# Contributing Guidelines

The brief set of rules in order of precedence:

1. don't be a d_ck to each other
2. use [JavaScript Standard Style](https://www.npmjs.com/package/standard)

Otherwise feel free to follow [the license](https://github.com/DeeSnow97/loljs-bot/LICENSE) and just do what the fuck you want to.

---
_Source: https://npm.io/package/loljs-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
