-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get threads from direct and usage extends cache interface (#758)
* can use extends cache interface (ex. /Illuminate/Contracts/Cache/Repository) * get threads * add example getThreads * fix all examples
- Loading branch information
Alexander Tarkhanov
authored
Sep 15, 2020
1 parent
1aeaf43
commit 1d7abb5
Showing
28 changed files
with
751 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<?php | ||
use Phpfastcache\Helper\Psr16Adapter; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', new Psr16Adapter('Files')); | ||
$instagram->login(); | ||
|
||
$stories = $instagram->getStories(); | ||
print_r($stories); | ||
print_r($stories); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
use Phpfastcache\Helper\Psr16Adapter; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', new Psr16Adapter('Files')); | ||
$instagram->login(); | ||
$instagram->saveSession(); | ||
|
||
$threads = $instagram->getThreads(10, 10, 20); | ||
$thread = $threads[0]; | ||
|
||
echo "Thread Info:\n"; | ||
echo "Id: {$thread->getId()}\n"; | ||
echo "Title: {$thread->getTitle()}\n"; | ||
echo "Type: {$thread->getType()}\n"; | ||
echo "Read State: {$thread->getReadState()}\n\n"; | ||
|
||
$items = $thread->getItems(); | ||
$item = $items[0]; | ||
|
||
echo "Item Info:\n"; | ||
echo "Id: {$item->getId()}\n"; | ||
echo "Type: {$item->getType()}\n"; | ||
echo "Time: {$item->getTime()}\n"; | ||
echo "User ID: {$item->getUserId()}\n"; | ||
echo "Text: {$item->getText()}\n\n"; | ||
|
||
$reelShare = $item->getReelShare(); | ||
|
||
echo "Reel Share Info:\n"; | ||
echo "Text: {$reelShare->getText()}\n"; | ||
echo "Type: {$reelShare->getType()}\n"; | ||
echo "Owner Id: {$reelShare->getOwnerId()}\n"; | ||
echo "Mentioned Id: {$reelShare->getMentionedId()}\n\n"; | ||
|
||
$reelMedia = $reelShare->getMedia(); | ||
|
||
echo "Reel Media Info:\n"; | ||
echo "Id: {$reelMedia->getId()}\n"; | ||
echo "Caption: {$reelMedia->getCaption()}\n"; | ||
echo "Code: {$reelMedia->getCode()}\n"; | ||
echo "Expiring At: {$reelMedia->getExpiringAt()}\n"; | ||
echo "Image: {$reelMedia->getImage()}\n\n"; | ||
|
||
// $user = $reelMedia->getUser(); // InstagramScraper\Model\Account | ||
// $mentions = $reelMedia->getMentions(); // InstagramScraper\Model\Account[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.