mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-03 00:40:58 +03:00
parent
d822d666c7
commit
7273a05f02
3 changed files with 16 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 = [];
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue