1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-08 17:46:34 +02:00

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
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;
}