1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-28 20:30:25 +02:00

[TwitterBridge] apikey fetched every time (#1663)

The apikey is fetched every time because $data is not an array. Update the condition to expire the api key at the same time as the guest token.
This commit is contained in:
triatic
2020-07-30 05:54:16 +01:00
committed by GitHub
parent a33088ca99
commit f5916a2f74

View File

@@ -374,7 +374,7 @@ EOD;
$data = $cache->loadData();
$apiKey = null;
if($data === null || !is_array($data) || count($data) != 1) {
if($data === null || (time() - $refresh) > self::GUEST_TOKEN_EXPIRY) {
$twitterPage = getContents('https://twitter.com');
$jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web_legacy\/main\.[^\.]+\.js)/m';