aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/GooglePlayStoreBridge.php32
-rw-r--r--bridges/TikTokBridge.php4
-rw-r--r--lib/RssBridge.php3
3 files changed, 16 insertions, 23 deletions
diff --git a/bridges/GooglePlayStoreBridge.php b/bridges/GooglePlayStoreBridge.php
index d61be2c8..86343520 100644
--- a/bridges/GooglePlayStoreBridge.php
+++ b/bridges/GooglePlayStoreBridge.php
@@ -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);
-
- $item = [];
- $item['uri'] = $appuri;
- $item['content'] = $html->find('div[itemprop=description]', 1)->innertext;
+ $id = $this->getInput('id');
+ $url = 'https://play.google.com/store/apps/details?id=' . $id;
+ $html = getSimpleHTMLDOM($url);
- // 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;
- }
+ $updatedAtElement = $html->find('div.TKjAsc div', 2);
+ // Updated onSep 27, 2023
+ $updatedAt = $updatedAtElement->plaintext;
+ $description = $html->find('div.bARER', 0);
+ $item = [];
+ $item['uri'] = $url;
+ $item['title'] = $id . ' ' . $updatedAt;
+ $item['content'] = $description->innertext ?? '';
+ $item['uid'] = 'GooglePlayStoreBridge/' . $updatedAt;
$this->items[] = $item;
}
diff --git a/bridges/TikTokBridge.php b/bridges/TikTokBridge.php
index 769bc625..73a18b04 100644
--- a/bridges/TikTokBridge.php
+++ b/bridges/TikTokBridge.php
@@ -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 = [];
diff --git a/lib/RssBridge.php b/lib/RssBridge.php
index 6ba952eb..2fb21323 100644
--- a/lib/RssBridge.php
+++ b/lib/RssBridge.php
@@ -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.