diff --git a/examples/getUserStoryByUrl.php b/examples/getUserStoryByUrl.php new file mode 100644 index 00000000..069373b8 --- /dev/null +++ b/examples/getUserStoryByUrl.php @@ -0,0 +1,26 @@ +getAccount($username); + $profile = $instagram->getStories([$account->getId()])[0]; + $stories = $profile->getStories(); + foreach ($stories as $story) { + if ($story->getId() == $id) { + return $story; + } + } +} + + +$instagram = \InstagramScraper\Instagram::withCredentials(new \GuzzleHttp\Client(), 'username', 'password', new Psr16Adapter('Files')); +$instagram->login(); + +$story = getStoryByUrl($instagram, "https://www.instagram.com/stories/hossinasaadi/2642429697467772762/"); +print_r($story);