Instagram-php-scraper: Issue in documentation: Instagram::withCredentials($login, $pass) does not work.

Created on 31 Mar 2020  Â·  9Comments  Â·  Source: postaddictme/instagram-php-scraper

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 ...

wontfix

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.

All 9 comments

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

https://www.google.com/url?q=https%3A%2F%2Fwww.facebook.com%2Faisriyadh&sa=D&sntz=1&usg=AFQjCNFhP9DAFozi0eHNGzoHOnn4EHiaOA

https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2FAISRiyadh&sa=D&sntz=1&usg=AFQjCNHD1XqrFNPcxAJqjjGOh-ER4NcWZQ

https://www.google.com/url?q=https%3A%2F%2Fwww.instagram.com%2Faisriyadh%2F&sa=D&sntz=1&usg=AFQjCNH_VLa1x29rO8cvTdbFphQL3jP1-w

@zubairsultan786
Did you install Phpfastcache first ?

composer require phpfastcache/phpfastcache

https://github.com/postaddictme/instagram-php-scraper/issues/558

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eelcol picture eelcol  Â·  5Comments

pauloamorimbr picture pauloamorimbr  Â·  7Comments

congkv picture congkv  Â·  4Comments

alabamaster picture alabamaster  Â·  6Comments

limminho picture limminho  Â·  8Comments