Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how get user media(post) count #72

Open
mohammad-rj opened this issue Oct 2, 2022 · 1 comment
Open

how get user media(post) count #72

mohammad-rj opened this issue Oct 2, 2022 · 1 comment

Comments

@mohammad-rj
Copy link
Contributor

mohammad-rj commented Oct 2, 2022

i get this response with trying getUser(), i need count post of user.
how can get that? i can feed by user and loop until end and counting media but this is a bad solution, is there any other way ?

Instagram\SDK\Response\Responses\Users\UserInformationResponse Object
(
    [user:Instagram\SDK\Response\Responses\Users\UserInformationResponse:private] => Instagram\SDK\Response\DTO\General\User Object
        (
            [id:Instagram\SDK\Response\DTO\General\User:private] => 7431104989
            [username:Instagram\SDK\Response\DTO\General\User:private] => krammpus_nacht
            [fullName:Instagram\SDK\Response\DTO\General\User:private] => Krammpus Nacht
            [isPrivate:Instagram\SDK\Response\DTO\General\User:private] =>
            [profilePictureUrl:Instagram\SDK\Response\DTO\General\User:private] =>
            [friendshipStatus:Instagram\SDK\Response\DTO\General\User:private] =>
            [isVerified:Instagram\SDK\Response\DTO\General\User:private] =>
            [hasAnonymousProfilePicture:Instagram\SDK\Response\DTO\General\User:private] =>
            [followerCount:Instagram\SDK\Response\DTO\General\User:private] => 908
            [followingCount:Instagram\SDK\Response\DTO\General\User:private] => 475
            [client:Instagram\SDK\Response\DTO\General\User:private] => Instagram\SDK\Client\Client Object
                (
                )

        )

    [client:Instagram\SDK\Response\Responses\Users\UserInformationResponse:private] => Instagram\SDK\Client\Client Object
        (
        )

    [status:protected] => ok
    [errorType:protected] =>
    [message:protected] =>
    [invalidCredentials:protected] =>
)
@mohammad-rj mohammad-rj changed the title how get user mesia(post) count how get user media(post) count Oct 2, 2022
@AndersonRezende
Copy link

AndersonRezende commented Oct 5, 2022

I got it using the following command:
sizeof($instagram->feedByUser($instagram->userByName("username")->getUser()->getId())->getItems());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants