public function processPage(Crawler $crawler) { $crawler->filter(".forumline.tablesorter tr")->each(function (Crawler $node) { $filter = $node->filter("td"); if (count($filter) && count($filter->eq(3))) { $name = trim($filter->eq(3)->text()); $torrentLink = trim($filter->eq(3)->filter('a')->attr('href')); $torrentLink = str_replace("./", 'http://rustorka.com/forum/', $torrentLink); $id = substr($torrentLink, strpos($torrentLink, "=") + 1); $seeders = trim($filter->eq(7)->text()); $leechers = trim($filter->eq(8)->text()); $downloadTimes = trim($filter->eq(9)->text()); $torrent = Torrent::where('name', '=', $name)->first(); if (!$torrent) { $torrent = new Torrent(); } $torrent->name = $name; $torrent->torrentLink = $torrentLink; $torrent->id = (int) $id; $torrent->seeders = (int) $seeders; $torrent->leechers = (int) $leechers; $torrent->downloadTimes = (int) $downloadTimes; $torrent->isSent = false; $torrent->save(); } }); }