* [TwitterBridge] Fix issue #1621 @<twitter_user> failed with error 429
This commit is contained in:
parent
23c61f5f84
commit
e87b868307
1 changed files with 3 additions and 2 deletions
|
@ -416,10 +416,11 @@ EOD;
|
||||||
// Get a guest token. This is different to an API key,
|
// Get a guest token. This is different to an API key,
|
||||||
// and it seems to change more regularly than the API key.
|
// and it seems to change more regularly than the API key.
|
||||||
private function getGuestToken() {
|
private function getGuestToken() {
|
||||||
$pageContent = getContents('https://twitter.com');
|
$pageContent = getContents('https://twitter.com', array(), array(), true);
|
||||||
|
|
||||||
$guestTokenRegex = '/gt=([0-9]*)/m';
|
$guestTokenRegex = '/gt=([0-9]*)/m';
|
||||||
preg_match_all($guestTokenRegex, $pageContent, $guestTokenMatches, PREG_SET_ORDER, 0);
|
preg_match_all($guestTokenRegex, $pageContent['header'], $guestTokenMatches, PREG_SET_ORDER, 0);
|
||||||
|
if (!$guestTokenMatches) returnServerError('Could not parse guest token');
|
||||||
$guestToken = $guestTokenMatches[0][1];
|
$guestToken = $guestTokenMatches[0][1];
|
||||||
return $guestToken;
|
return $guestToken;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue