[RadioMelodieBridge] Fix date parsing (#2701)

The date is now correctly parsed for every month in the year (There are months mane in french that are 3 letters long
This commit is contained in:
sysadminstory 2022-05-08 04:19:06 +02:00 committed by GitHub
parent 56e991122b
commit 37843e8777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -56,8 +56,10 @@ class RadioMelodieBridge extends BridgeAbstract {
// Handle date to timestamp // Handle date to timestamp
$dateHTML = $article->find('div[class=author]', 0)->children(1)->plaintext; $dateHTML = $article->find('div[class=author]', 0)->children(1)->plaintext;
preg_match('/([a-z]{4,10}[ ]{1,2}[0-9]{1,2} [\p{L}]{4,10} [0-9]{4} à [0-9]{2}:[0-9]{2})/mus', $dateHTML, $matches);
preg_match('/([a-z]{4,10}[ ]{1,2}[0-9]{1,2} [\p{L}]{3,10} [0-9]{4} à [0-9]{2}:[0-9]{2})/mus', $dateHTML, $matches);
$dateText = $matches[1]; $dateText = $matches[1];
$timestamp = $this->parseDate($dateText); $timestamp = $this->parseDate($dateText);
$item['enclosures'] = array_merge($picture, $audio); $item['enclosures'] = array_merge($picture, $audio);