Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by NetWallah (Canon)
on Feb 13, 2018 at 05:37 UTC ( #1209041=note: print w/replies, xml ) Need Help??

in reply to Can't get API::Instagram to work

The code you posted does not compile, because "didn't" contains an embedded quote.
Please post code you actually tested.

The documentation for the Instagram 'code' related to authorization is at , under "Receiving an access_token".

The API::Instagram module's documentation points you to to that URL: "See for details.".

UPDATE: Typo corrected. Thanks, AnomalousMonk.

                Python is a racist language what with it's dependence on white space!

Replies are listed 'Best First'.
Re^2: Can't get API::Instagram to work
by igoryonya (Monk) on Feb 13, 2018 at 10:46 UTC
    because "didn't" I fixed it.
    I was here:
    and hree:
    before I've posted my question and I've mentioned about it in my question.
    with /register/, I've got 'client_id and client_secret and set it up in object creation, as I mentioned in code sample
    /authentication/, I've read, but it doesn't explain the API::Instagram perl library. 'code' explanation is very vague in both places.
    I didn't find how to get 'code', by using library. I did flollow an $instagram->get_auth_url (with the browser), just to find out, if there will be the 'code', and had to click the 'authenticate' button, then it opened a page with JSON code, where it, had 'code' value. I assumed, that that 'code' was the one, that I needed to use in $instagram->code(), so, I've tried to insert the code, copied from that JSON page here: $instagram->code('copied_code'), but it didn't do anything to solve my issue. Also, even if if would, wouldn't if defy th e porpuse of library. I figure, this is module's job to gather that 'code'.

      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.

        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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1209041]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-06-23 20:48 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.