mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 06:14:56 +03:00
[TwitterBridge] Enable cookies with curl (#1245)
* [TwitterBridge] Enable cookies with curl Enable cookies in curl, or fall back to `file_get_contents` if in CLI mode with no curl root certificates.
This commit is contained in:
parent
7aba7992aa
commit
50c971d545
1 changed files with 7 additions and 2 deletions
|
@ -171,9 +171,14 @@ EOD
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = '';
|
$html = '';
|
||||||
$page = $this->getURI();
|
$page = $this->getURI();
|
||||||
$cookies = $this->getCookies($page);
|
|
||||||
|
|
||||||
$html = getSimpleHTMLDOM($page, array("Cookie: $cookies"));
|
if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) {
|
||||||
|
$cookies = $this->getCookies($page);
|
||||||
|
$html = getSimpleHTMLDOM($page, array("Cookie: $cookies"));
|
||||||
|
} else {
|
||||||
|
$html = getSimpleHTMLDOM($page, array(), array(CURLOPT_COOKIEFILE => ''));
|
||||||
|
}
|
||||||
|
|
||||||
if(!$html) {
|
if(!$html) {
|
||||||
switch($this->queriedContext) {
|
switch($this->queriedContext) {
|
||||||
case 'By keyword or hashtag':
|
case 'By keyword or hashtag':
|
||||||
|
|
Loading…
Add table
Reference in a new issue