Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Can't get API::Instagram to work

by marto (Cardinal)
on Feb 13, 2018 at 11:04 UTC ( [id://1209056]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can't get API::Instagram to work
in thread Can't get API::Instagram to work

The code you have posted seems to be a mish mash of the code from the modules synopsis, and different parts of the documentation.

my $code = "I didn't find in documentation, what is this code, and how + do I get it"; $instagram->code($code);

Both the instagram docs and the example code for the new constructor show how to specify the response type, which I suggest you try:

use API::Instagram; my $instagram = API::Instagram->new({ client_id => 'xxxxxxxxxx', client_secret => 'xxxxxxxxxx', redirect_uri => 'http://localhost', scope => 'basic', response_type => 'code' granty_type => 'authorization_code', }); print $instagram->get_auth_url;

In fact the lines following your attempt match those that follow this type of usage.

Replies are listed 'Best First'.
Re^4: Can't get API::Instagram to work
by igoryonya (Pilgrim) on Feb 13, 2018 at 20:51 UTC
    I already got this part, i.e.: logged in and got auth url. What's next?
    As I said, I can't figure out how to authenticate and ultimately, list posts.
    I would really appreciate a working code example.
    Thank You.

      "I already got this part, i.e.: logged in and got auth url"

      This isn't in the code you've posted, it doesn't match the example from the docs.

      "I can't figure out how to authenticate and ultimately, list posts. I would really appreciate a working code example."

      With the exception of the Instagram documentation that I looked at out of curiosity, I know nothing about their system, what it does or why anyone would use it. That said the API::Instagram documentation has examples of how to get a users 'feed' (if this is what you mean by posts?):

      my $feed = $my_user->feed( count => 5 ); for my $media ( @$feed ) { printf "Caption: %s\n", $media->caption; printf "Posted by %s at %s (%d likes)\n\n", $media->user->user +name, $media->created_time, $media->likes; }

      "I would really appreciate a working code example."

      I don't have any use case for this, and am not going to jump through the hoops to get an account/API keys etc.. My suggestion would be to Use the source Luke. You have the API documentation from Instagram, you have the Perl source code for this module. Work the problem. Perhaps some of the tests can point you in the right direction. Once you work out what you want, consider suggesting improvements to the module documentation if you feel this would be of benefit.

      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209056]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found