From 4f23a9404b68a8cae07bb913a46fd34a787b963f Mon Sep 17 00:00:00 2001 From: eai04191 Date: Thu, 22 Aug 2019 07:47:42 +0900 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=89=8D=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/MetadataResolver/IwaraResolver.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/MetadataResolver/IwaraResolver.php b/app/MetadataResolver/IwaraResolver.php index a518d24..b876315 100644 --- a/app/MetadataResolver/IwaraResolver.php +++ b/app/MetadataResolver/IwaraResolver.php @@ -25,14 +25,14 @@ class IwaraResolver implements Resolver $html = (string) $res->getBody(); $crawler = new Crawler($html); - $descriptionElement = $crawler->filter('#video-player + div, .field-name-field-video-url + div, .field-name-field-images + div'); - $title = $descriptionElement->filter('h1.title')->text(); - $author = $descriptionElement->filter('.username')->text(); + $infoElements = $crawler->filter('#video-player + div, .field-name-field-video-url + div, .field-name-field-images + div'); + $title = $infoElements->filter('h1.title')->text(); + $author = $infoElements->filter('.username')->text(); $description = ''; - if ($descriptionElement->filter('.field-type-text-with-summary')->count()) { - $description = $descriptionElement->filter('.field-type-text-with-summary')->text(); + if ($infoElements->filter('.field-type-text-with-summary')->count()) { + $description = $infoElements->filter('.field-type-text-with-summary')->text(); } - $tags = $descriptionElement->filter('a[href^="/video-categories"], a[href^="/images"]')->extract('_text'); + $tags = $infoElements->filter('a[href^="/video-categories"], a[href^="/images"]')->extract('_text'); // 役に立たないタグを削除する $tags = array_values(array_diff($tags, ['Uncategorized', 'Other'])); array_push($tags, $author);