PHPackages                             yomo/redditbot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yomo/redditbot

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

yomo/redditbot
==============

Laravel package for developing Reddit bots

v1.0.3(7y ago)41861[1 issues](https://github.com/nonsapiens/redditbot/issues)MITPHP

Since Jan 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nonsapiens/redditbot)[ Packagist](https://packagist.org/packages/yomo/redditbot)[ RSS](/packages/yomo-redditbot/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (5)Used By (0)

RedditBot
=========

[](#redditbot)

RedditBot is a simple-to-use Laravel 5.x library that wraps the Reddit API to make reading, posting and commenting on Reddit threads really easy!

This library was partially inspired by [Decronym](https://gist.github.com/Two9A/1d976f9b7441694162c8).

Installation
------------

[](#installation)

Require this package with composer using the following command:

```
composer require yomo/redditbot
```

### Laravel 5.5 or higher

[](#laravel-55-or-higher)

Execute:

```
php artisan vendor:publish --tag=redditbot
```

### Laravel 5.4 or lower

[](#laravel-54-or-lower)

If you are running Laravel 5.4 and below, you need to add the service provider to the `providers` array in `config/app.php`

```
Redditbot\Providers\RedditbotServiceProvider::class
```

Then execute:

```
php artisan vendor:publish --tag=redditbot
```

Usage
-----

[](#usage)

This library assumes your bot has already been created through [Reddit's App Panel](https://www.reddit.com/prefs/apps/), through which you would need to register a "personal use script" application.
More details on how to configure your bot can be found [via Reddit's Quick Start instructions](https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example)

Your .env file will require the following settings:

```
REDDIT_USERNAME
REDDIT_PASSWORD
REDDIT_APP_ID
REDDIT_APP_SECRET
```

### Retrieving comments from a subreddit and responding

[](#retrieving-comments-from-a-subreddit-and-responding)

Once this is configured, you can create an instance of the Reddit class with:

```
$reddit = new Reddit();
$comments = $reddit->fetchComments('sheiseverywhere');
```

Comments are returned as a Collection, which you can easily iterate through using **foreach** or **-&gt;each**. An example below shows how the bot replies to any instance of a specific phrase, using the "sinceLastCheck" function:

```
$reddit = new Reddit();
$comments = $reddit->fetchComments('jimny');

$comments->sinceLastCheck()->each(function($comment){

   if (strpos($comment->body, 'Suzuki Jimny') !== false) {
     $comment->reply('The Suzuki Jimny is the best off-roader ever built');   # This replies to the specific comment
     $comment->comment('Visit /r/jimny for more information'); # This submits a top-level post to the main thread
   }

});
```

There is also a Facade available, with an example shown below:

```
   $firstNewComment = Reddit::fetchComments('jimny')->sinceLastCheck()->first();
```

About the author
----------------

[](#about-the-author)

[**Stuart Steedman**](https://www.linkedin.com/in/stuart-steedman-b612a537/) is the head of development at [Yonder Media](http://www.yonder.co.za), a South African digital media agency operating out of Pretoria. He specialises in PHP and Laravel development, and is a speaker at tech and development related conferences.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2664d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d8b2540548fd4037017a3177a24b230506c67ca96d5ed870cd82153726e597f?d=identicon)[nonsapiens](/maintainers/nonsapiens)

---

Top Contributors

[![stuartsteedman](https://avatars.githubusercontent.com/u/69784087?v=4)](https://github.com/stuartsteedman "stuartsteedman (7 commits)")[![nonsapiens](https://avatars.githubusercontent.com/u/9744534?v=4)](https://github.com/nonsapiens "nonsapiens (1 commits)")

### Embed Badge

![Health badge](/badges/yomo-redditbot/health.svg)

```
[![Health](https://phpackages.com/badges/yomo-redditbot/health.svg)](https://phpackages.com/packages/yomo-redditbot)
```

###  Alternatives

[samgranger/module-store-code-body-class

The Store Code Body Class module for Magento2 adds the website &amp; store code to the body class.

3260.3k](/packages/samgranger-module-store-code-body-class)[ropendev/datatablesphp

PHP DataTables wrapper class for DataTables.js (Html and/or Javascript generation, Server-Side SQL) .

286.7k](/packages/ropendev-datatablesphp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
