[TwitterBridge] Use IE's user-agent (#1442)

Twitter will return pages with legacy design and frontend code, which bridge can deal with
This commit is contained in:
Eugene Molotov 2020-01-31 18:36:25 +05:00 committed by GitHub
parent 6a90a9d33f
commit 830f57f607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,11 +172,15 @@ EOD
$html = ''; $html = '';
$page = $this->getURI(); $page = $this->getURI();
$header = array(
'User-Agent: Mozilla/5.0 (Windows NT 9.0; WOW64; Trident/7.0; rv:11.0) like Gecko'
);
if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) { if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) {
$cookies = $this->getCookies($page); $cookies = $this->getCookies($page);
$html = getSimpleHTMLDOM($page, array("Cookie: $cookies")); $html = getSimpleHTMLDOM($page, array_merge($header, array("Cookie: $cookies")));
} else { } else {
$html = getSimpleHTMLDOM($page, array(), array(CURLOPT_COOKIEFILE => '')); $html = getSimpleHTMLDOM($page, $header, array(CURLOPT_COOKIEFILE => ''));
} }
if(!$html) { if(!$html) {