<commit_before><?php

/**
 * This file is part of GitterBot package.
 *
 * @author Serafim <<EMAIL>>
 * @date 24.09.2015 15:27
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\Console\Commands;


use App\Room;
use App\Gitter\Client;
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Container\Container;


/**
 * Class StartGitterBot
 * @package App\Console\Commands
 */
class StartGitterBot extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'gitter:listen {room}';


    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Start gitter bot thread for target room.';


    /**
     * @var Container
     */
    protected $container;


    /**
     * Execute the console command.
     *
     * @param Repository $config
     * @param Container $container
     *
     * @return mixed
     * @throws \InvalidArgumentException
     * @throws \RuntimeException
     * @throws \LogicException
     * @throws \Exception
     */
    public function handle(Repository $config, Container $container)
    {
        $client = Client::make($config->get('gitter.token'), $this->argument('room'));

        $stream = $container->make(Room::class)->listen();
        $client->run();
    }
}<commit_msg>Add bot info<commit_after><?php

/**
 * This file is part of GitterBot package.
 *
 * @author Serafim <<EMAIL>>
 * @date 24.09.2015 15:27
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\Console\Commands;


use App\Room;
use App\Gitter\Client;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Container\Container;


/**
 * Class StartGitterBot
 * @package App\Console\Commands
 */
class StartGitterBot extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'gitter:listen {room}';


    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Start gitter bot thread for target room.';


    /**
     * @var Container
     */
    protected $container;


    /**
     * Execute the console command.
     *
     * @param Repository $config
     * @param Container $container
     *
     * @return mixed
     * @throws \InvalidArgumentException
     * @throws \RuntimeException
     * @throws \LogicException
     * @throws \Exception
     */
    public function handle(Repository $config, Container $container)
    {
        $started = Carbon::now();
        $client  = Client::make($config->get('gitter.token'), $this->argument('room'));
        $stream  = $container->make(Room::class)->listen();

        $this->line(sprintf(' Gitter Bot %s started at %s', Client::VERSION, $started->toDateTimeString()));

        $client->getEventLoop()->addPeriodicTimer(1, function() use ($started) {
            $memory = number_format(memory_get_usage(true) / 1000 / 1000, 2);
            $uptime = Carbon::now()->diff($started);

            $this->output->write("\r" . sprintf(
                '[memory: %smb] [uptime: %s]%60s',
                $memory,
                $uptime->format('%Y.%M.%D %H:%I:%S'),
                ''
            ));
        });

        $client->run();
    }
}
{'fraction_non_alphanumeric': 0.1349384098544233, 'fraction_numerical': 0.010078387458006719, 'mean_word_length': 2.530632411067194, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4997328', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1020, 'n_words': 271}