-
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.
- Loading branch information
Showing
8 changed files
with
135 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use InstagramScraper\Model\Media; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
|
||
echo 'CODE: ' . Media::getCodeFromId('1270593720437182847_3'); | ||
// OR | ||
echo 'CODE: ' . Media::getCodeFromId('1270593720437182847'); | ||
// CODE: BGiDkHAgBF_ | ||
// So you can do like this: instagram.com/p/BGiDkHAgBF_ | ||
|
||
|
||
echo 'Media id: ' . Media::getIdFromCode('BGiDkHAgBF_'); | ||
// Media id: 1270593720437182847 |
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,24 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram->login(); | ||
|
||
$medias = $instagram->getCurrentTopMediasByLocationId('1'); | ||
$media = $medias[0]; | ||
echo "Media info:\n"; | ||
echo "Id: {$media->getId()}\n"; | ||
echo "Shotrcode: {$media->getShortCode()}\n"; | ||
echo "Created at: {$media->getCreatedTime()}\n"; | ||
echo "Caption: {$media->getCaption()}\n"; | ||
echo "Number of comments: {$media->getCommentsCount()}"; | ||
echo "Number of likes: {$media->getLikesCount()}"; | ||
echo "Get link: {$media->getLink()}"; | ||
echo "High resolution image: {$media->getImageHighResolutionUrl()}"; | ||
echo "Media type (video or image): {$media->getType()}"; | ||
$account = $media->getOwner(); | ||
echo "Account info:\n"; | ||
echo "Id: {$account->getId()}\n"; | ||
echo "Username: {$account->getUsername()}\n"; | ||
echo "Full name: {$account->getFullName()}\n"; | ||
echo "Profile pic url: {$account->getProfilePicUrl()}\n"; |
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,24 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram->login(); | ||
|
||
$medias = $instagram->getCurrentTopMediasByTagName('youneverknow'); | ||
$media = $medias[0]; | ||
echo "Media info:\n"; | ||
echo "Id: {$media->getId()}\n"; | ||
echo "Shotrcode: {$media->getShortCode()}\n"; | ||
echo "Created at: {$media->getCreatedTime()}\n"; | ||
echo "Caption: {$media->getCaption()}\n"; | ||
echo "Number of comments: {$media->getCommentsCount()}"; | ||
echo "Number of likes: {$media->getLikesCount()}"; | ||
echo "Get link: {$media->getLink()}"; | ||
echo "High resolution image: {$media->getImageHighResolutionUrl()}"; | ||
echo "Media type (video or image): {$media->getType()}"; | ||
$account = $media->getOwner(); | ||
echo "Account info:\n"; | ||
echo "Id: {$account->getId()}\n"; | ||
echo "Username: {$account->getUsername()}\n"; | ||
echo "Full name: {$account->getFullName()}\n"; | ||
echo "Profile pic url: {$account->getProfilePicUrl()}\n"; |
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,24 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram->login(); | ||
|
||
$medias = $instagram->getMediasByLocationId('1', 20); | ||
$media = $medias[0]; | ||
echo "Media info:\n"; | ||
echo "Id: {$media->getId()}\n"; | ||
echo "Shotrcode: {$media->getShortCode()}\n"; | ||
echo "Created at: {$media->getCreatedTime()}\n"; | ||
echo "Caption: {$media->getCaption()}\n"; | ||
echo "Number of comments: {$media->getCommentsCount()}"; | ||
echo "Number of likes: {$media->getLikesCount()}"; | ||
echo "Get link: {$media->getLink()}"; | ||
echo "High resolution image: {$media->getImageHighResolutionUrl()}"; | ||
echo "Media type (video or image): {$media->getType()}"; | ||
$account = $media->getOwner(); | ||
echo "Account info:\n"; | ||
echo "Id: {$account->getId()}\n"; | ||
echo "Username: {$account->getUsername()}\n"; | ||
echo "Full name: {$account->getFullName()}\n"; | ||
echo "Profile pic url: {$account->getProfilePicUrl()}\n"; |
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,24 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram->login(); | ||
|
||
$medias = $instagram->getMediasByTag('youneverknow', 20); | ||
$media = $medias[0]; | ||
echo "Media info:\n"; | ||
echo "Id: {$media->getId()}\n"; | ||
echo "Shotrcode: {$media->getShortCode()}\n"; | ||
echo "Created at: {$media->getCreatedTime()}\n"; | ||
echo "Caption: {$media->getCaption()}\n"; | ||
echo "Number of comments: {$media->getCommentsCount()}"; | ||
echo "Number of likes: {$media->getLikesCount()}"; | ||
echo "Get link: {$media->getLink()}"; | ||
echo "High resolution image: {$media->getImageHighResolutionUrl()}"; | ||
echo "Media type (video or image): {$media->getType()}"; | ||
$account = $media->getOwner(); | ||
echo "Account info:\n"; | ||
echo "Id: {$account->getId()}\n"; | ||
echo "Username: {$account->getUsername()}\n"; | ||
echo "Full name: {$account->getFullName()}\n"; | ||
echo "Profile pic url: {$account->getProfilePicUrl()}\n"; |
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,15 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$instagram = \InstagramScraper\Instagram::withCredentials('username', 'password', '/path/to/cache/folder'); | ||
$instagram->login(); | ||
|
||
$result = $instagram->getPaginateMediasByTag('zara'); | ||
$medias = $result['medias']; | ||
|
||
if ($result['hasNextPage'] === true) { | ||
$result = $instagram->getPaginateMediasByTag('zara', $result['maxId']); | ||
$medias = array_merge($medias, $result['medias']); | ||
} | ||
|
||
echo json_encode($medias); |
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