postaddictme / instagram-php-scraper

Get account information, photos, videos, stories and comments.
https://packagist.org/packages/raiym/instagram-php-scraper
MIT License
3.08k stars 798 forks source link

getting usernames by id #51

Closed shawngraham closed 7 years ago

shawngraham commented 7 years ago

Hi,

Just playing with this; thank you for putting it together. I am able to get all the other examples in your readme to work for me, except the get account by id. My code:

<?php

require_once 'vendor/autoload.php';
use InstagramScraper\Instagram;

$account = Instagram::getAccountById('193886659');
echo $account->username;

?>

Error:

Fatal error: Uncaught exception 'InstagramScraper\Exception\InstagramException' with message 'Response code is 405. Body:  Something went wrong. Please report issue.' in /Users/shawngraham/experiments/instagram-php-scraper-master/src/InstagramScraper/Instagram.php:46
Stack trace:
#0 /Users/shawngraham/experiments/instagram-php-scraper-master/getaccount.php(6): InstagramScraper\Instagram::getAccountById('193886659')
#1 {main}
  thrown in /Users/shawngraham/experiments/instagram-php-scraper-master/src/InstagramScraper/Instagram.php on line 46

Cheers

raiym commented 7 years ago

Hello! Please update library to last version It was fixed

On Dec 6, 2016 19:10, "Shawn Graham" notifications@github.com wrote:

Hi,

Just playing with this; thank you for putting it together. I am able to get all the other examples in your readme to work for me, except the get account by id. My code:

<?phprequire_once 'vendor/autoload.php';use InstagramScraper\Instagram;$account = Instagram::getAccountById('193886659');echo $account->biography;?>

Error:

Fatal error: Uncaught exception 'InstagramScraper\Exception\InstagramException' with message 'Response code is 405. Body: Something went wrong. Please report issue.' in /Users/shawngraham/experiments/instagram-php-scraper-master/src/InstagramScraper/Instagram.php:46 Stack trace:#0 /Users/shawngraham/experiments/instagram-php-scraper-master/getaccount.php(6): InstagramScraper\Instagram::getAccountById('193886659')#1 {main} thrown in /Users/shawngraham/experiments/instagram-php-scraper-master/src/InstagramScraper/Instagram.php on line 46

Cheers

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/postaddictme/instagram-php-scraper/issues/51, or mute the thread https://github.com/notifications/unsubscribe-auth/AFb0GSF9txBH993gRCV6hhziW1JEASxCks5rFYjpgaJpZM4LFlZm .

shawngraham commented 7 years ago

ha, great: thank you!