1. Go to this page and download the library: Download yomo/redditbot library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$reddit = new Reddit();
$comments = $reddit->fetchComments('sheiseverywhere');
$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
}
});