<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class CrawlHostelPost extends Command {
	/**
	 * The name and signature of the console command.
	 *
	 * @var string
	 */
	protected $signature = 'crawl:post';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Command description';

	/**
	 * Create a new command instance.
	 *
	 * @return void
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function handle() {
		//
		$groupIds = [
			'825925497564839',
			'1450654444955381',
			'181974892456424',
			'497566003596002',
			'199750650586151',
			'375742012634562',
			'1847853468851310',
			'191899480971591'
		];

		foreach ( $groupIds as $groupId ) {
			file_get_contents( 'http://localhost:8080/group/' . $groupId );
			$this->line('Finished crawl '.$groupId);
		}
	}
}
