[VkBridge] Follow site changes (#3244)

This commit is contained in:
Eugene Molotov 2023-02-07 19:10:43 +05:00 committed by GitHub
parent 7f1b32f390
commit 91f91ba621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,7 +316,7 @@ class VkBridge extends BridgeAbstract
$item['categories'] = $hashtags; $item['categories'] = $hashtags;
// get post link // get post link
$post_link = $post->find('a.post_link', 0)->getAttribute('href'); $post_link = $post->find('a.PostHeaderSubtitle__link', 0)->getAttribute('href');
preg_match('/wall-?\d+_(\d+)/', $post_link, $preg_match_result); preg_match('/wall-?\d+_(\d+)/', $post_link, $preg_match_result);
$item['post_id'] = intval($preg_match_result[1]); $item['post_id'] = intval($preg_match_result[1]);
$item['uri'] = $post_link; $item['uri'] = $post_link;
@ -393,10 +393,10 @@ class VkBridge extends BridgeAbstract
private function getTime($post) private function getTime($post)
{ {
if ($time = $post->find('span.rel_date', 0)->getAttribute('time')) { if ($time = $post->find('time.PostHeaderSubtitle__item', 0)->getAttribute('time')) {
return $time; return $time;
} else { } else {
$strdate = $post->find('span.rel_date', 0)->plaintext; $strdate = $post->find('time.PostHeaderSubtitle__item', 0)->plaintext;
$strdate = preg_replace('/[\x00-\x1F\x7F-\xFF]/', ' ', $strdate); $strdate = preg_replace('/[\x00-\x1F\x7F-\xFF]/', ' ', $strdate);
$date = date_parse($strdate); $date = date_parse($strdate);