The code from the documentation does not work.
Example:
$i = \InstagramScraper\Instagram::withCredentials('my-login', 'my-pass');
Got error:
PHP Fatal error: Uncaught TypeError: Argument 3 passed to InstagramScraper\Instagram::withCredentials() must be an instance of Psr\SimpleCache\CacheInterface, none given, called in ...
use Phpfastcache\Helper\Psr16Adapter;
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', new Psr16Adapter('Files'));
@ig0r74 The package phpfastcache/phpfastcache is NOT included by default as a required dependency. I assume it has to be.
Anyway, the documentation contains described error.
Same code i used still it gives me error
change this method in Instagram.php to ====>
public static function withCredentials($username, $password)
{
if (static::$instanceCache == null) {
static::$instanceCache = new Psr16Adapter('Files');
}
$instance = new self();
$instance->sessionUsername = $username;
$instance->sessionPassword = $password;
return $instance;
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@benlumley
I suggest to you expand Argument 3 and Psr16Adapter in README project. And set this package by default.
And also seem should change argument 3 ('/path/to/cache/folder') in all examples:
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder');
I did same @nabi karam but same result it's giving me error
On Thu, Jul 23, 2020 at 7:20 PM Nabi KaramAliZadeh notifications@github.com
wrote:
I suggest to you expand Argument 3 and Psr16Adapter in README project. And
set this package by default.
And also seem should change argument 3 in all examples:$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder');
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postaddictme/instagram-php-scraper/issues/636#issuecomment-663100542,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIHRSC46Y5Z5WHQSOSZR3L3R5BPLXANCNFSM4LX4R53Q
.
--
Zubair Sultan Skyward Manager
https://www.google.com/url?q=https%3A%2F%2Fwww.aisr.org&sa=D&sntz=1&usg=AFQjCNFdGgwUctCn41yHhAu9Bwvk_-UTiw
[email protected] asultan@aisr.org
American International School - Riyadh
https://www.google.com/url?q=https%3A%2F%2Fwww.aisr.org&sa=D&sntz=1&usg=AFQjCNFdGgwUctCn41yHhAu9Bwvk_-UTiw
Box 990, Riyadh 11421, KSA
Tel: +966-11-459-7500 ext: 337
@zubairsultan786
Did you install Phpfastcache first ?
composer require phpfastcache/phpfastcache
https://github.com/postaddictme/instagram-php-scraper/issues/558
Yes I installed it. It worked but after few days same error is occurring
On Sat, Jul 25, 2020 at 9:32 AM Nabi KaramAliZadeh notifications@github.com
wrote:
@zubairsultan786 https://github.com/zubairsultan786
Did you install Phpfastcache first ?composer require phpfastcache/phpfastcache
558 https://github.com/postaddictme/instagram-php-scraper/issues/558
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/postaddictme/instagram-php-scraper/issues/636#issuecomment-663817554,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIHRSC7GDGSPYQ5VZ47I3QTR5J37ZANCNFSM4LX4R53Q
.
--
Zubair Sultan Skyward Manager
https://www.google.com/url?q=https%3A%2F%2Fwww.aisr.org&sa=D&sntz=1&usg=AFQjCNFdGgwUctCn41yHhAu9Bwvk_-UTiw
[email protected] asultan@aisr.org
American International School - Riyadh
https://www.google.com/url?q=https%3A%2F%2Fwww.aisr.org&sa=D&sntz=1&usg=AFQjCNFdGgwUctCn41yHhAu9Bwvk_-UTiw
Box 990, Riyadh 11421, KSA
Tel: +966-11-459-7500 ext: 337
Most helpful comment
@ig0r74 The package phpfastcache/phpfastcache is NOT included by default as a required dependency. I assume it has to be.
Anyway, the documentation contains described error.