fix: google play and tiktok (#3722)

* fix(googleplay)

* fix(tiktok)
This commit is contained in:
Dag 2023-10-01 18:53:50 +02:00 committed by GitHub
parent d822d666c7
commit 7273a05f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 23 deletions

View File

@ -21,30 +21,22 @@ class GooglePlayStoreBridge extends BridgeAbstract
]
]];
const INFORMATION_MAP = [
'Updated' => 'timestamp',
'Current Version' => 'title',
'Offered By' => 'author'
];
public function collectData()
{
$appuri = static::URI . '/details?id=' . $this->getInput('id');
$html = getSimpleHTMLDOM($appuri);
$id = $this->getInput('id');
$url = 'https://play.google.com/store/apps/details?id=' . $id;
$html = getSimpleHTMLDOM($url);
$updatedAtElement = $html->find('div.TKjAsc div', 2);
// Updated onSep 27, 2023
$updatedAt = $updatedAtElement->plaintext;
$description = $html->find('div.bARER', 0);
$item = [];
$item['uri'] = $appuri;
$item['content'] = $html->find('div[itemprop=description]', 1)->innertext;
// Find other fields from Additional Information section
foreach ($html->find('.hAyfc') as $info) {
$index = self::INFORMATION_MAP[$info->first_child()->plaintext] ?? null;
if (is_null($index)) {
continue;
}
$item[$index] = $info->children(1)->plaintext;
}
$item['uri'] = $url;
$item['title'] = $id . ' ' . $updatedAt;
$item['content'] = $description->innertext ?? '';
$item['uid'] = 'GooglePlayStoreBridge/' . $updatedAt;
$this->items[] = $item;
}

View File

@ -40,6 +40,10 @@ class TikTokBridge extends BridgeAbstract
$SIGI_STATE_RAW = $var->innertext;
$SIGI_STATE = Json::decode($SIGI_STATE_RAW, false);
if (!isset($SIGI_STATE->ItemModule)) {
return;
}
foreach ($SIGI_STATE->ItemModule as $key => $value) {
$item = [];

View File

@ -39,9 +39,6 @@ final class RssBridge
$line
);
self::$logger->warning($text);
if (Debug::isEnabled()) {
print sprintf("<pre>%s</pre>\n", e($text));
}
});
// There might be some fatal errors which are not caught by set_error_handler() or \Throwable.