diff --git a/bridges/YorushikaBridge.php b/bridges/YorushikaBridge.php index d528999a..d75b97d7 100644 --- a/bridges/YorushikaBridge.php +++ b/bridges/YorushikaBridge.php @@ -41,7 +41,6 @@ class YorushikaBridge extends BridgeAbstract public function collectData() { - $url = 'https://yorushika.com/news/5/'; switch ($this->getInput('lang')) { case 'jp': $url = 'https://yorushika.com/news/5/'; @@ -99,14 +98,8 @@ class YorushikaBridge extends BridgeAbstract // Get article date $date = $art->find('.date', 0)->plaintext; - if (preg_match('/(\d)年(\d)月(\d)/', $date, $matches)) { - // Some dates will contain Chinese characters, remove those from the string - $formattedDate = sprintf('%d.%02d.%02d', $matches[1], $matches[2], $matches[3]); - } else { - // Assume the date is already in 'Y.m.d' format - preg_match('/\d+\.\d+\.\d+/', $date, $matches); - $formattedDate = $matches[0]; - } + preg_match('/(\d+)[\.年](\d+)[\.月](\d+)/u', $date, $matches); + $formattedDate = sprintf('%d.%02d.%02d', $matches[1], $matches[2], $matches[3]); $date = date_create_from_format('Y.m.d', $formattedDate); $date = date_format($date, 'd.m.Y');