Hopefuly fix scraping

This commit is contained in:
DariusIII
2018-07-08 17:36:47 +02:00
parent 47f052a440
commit ab59f845a3
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -343,14 +343,14 @@ class IRCClient
$this->_pong($matches[1]);
} elseif (preg_match('/^:(.*?)\s+(\d+).*?(:.+?)?$/', $this->_buffer, $matches)) {
// We found 001, which means we are logged in.
if ($matches[2] == 001) {
if ((int) $matches[2] === 1) {
$this->_remote_host_received = $matches[1];
break;
// We got 464, which means we need to send a password.
}
if ($matches[2] == 464) {
if ((int)$matches[2] === 464) {
// Before the lower check, set the password : username:password
$tempPass = $userName.':'.$password;
+4 -1
View File
@@ -4,6 +4,7 @@ namespace Blacklight;
use App\Models\Group;
use App\Models\Predb;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
/**
@@ -219,7 +220,9 @@ class IRCScraper extends IRCClient
return;
}
$this->_curPre['predate'] = 'FROM_UNIXTIME((strtotime($matches["time"]." UTC")))';
$utime = Carbon::createFromTimeString($matches['time'], 'UTC')->timestamp;
$this->_curPre['predate'] = 'FROM_UNIXTIME('.$utime.')';
$this->_curPre['title'] = $matches['title'];
$this->_curPre['source'] = $matches['source'];
if ($matches['category'] !== 'N/A') {