instagram-node-lib icon indicating copy to clipboard operation
instagram-node-lib copied to clipboard

Example code for requesting an access token stalls for me

Open ryanburnette opened this issue 12 years ago • 2 comments

I tried the example code for requesting an access token. The function with complete and error events never calls either of those options. I'm learning Nodejs right now so I'm unable to troubleshoot. Just curious if this code example is still relevant, or incomplete.

Feel free to close if there is no real issue here.

Thanks

https://github.com/mckelvey/instagram-node-lib#ask-for-an-access-token

ryanburnette avatar Jul 16 '13 15:07 ryanburnette

I'm not clear on whether the test is passing or not.

How I tested:

https://github.com/mckelvey/instagram-node-lib#tests

git clone [email protected]:mckelvey/instagram-node-lib.git
pushd instagram-node-lib/

export CLIENT_ID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# README.md say CALLBACK_URL, but it needs REDIRECT_URI
#export CALLBACK_URL="http://localhost:3001/oauth/instagram"
export REDIRECT_URI="http://localhost:3001/oauth/instagram"

npm install --dev
# This didn't work 
#npm test oauth
npm install -g expresso
expresso ./test/instagram.oauth.js

What I saw as a result:

Instagram API Node.js Lib Tests :: OAuth

oauth#roundtrip
   result matched authorization url
      it was: https://api.instagram.com/oauth/authorize/?scope=comments%20likes&display=touch&client_id=cb681313c0d34b6fb3734893c3f572fc&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Foauth%2Finstagram&response_type=code
   response met redirect criteria
      it was: https://instagram.com/fake/oauth/authorize/?scope=comments%20likes&display=touch&client_id=cb681313c0d34b6fb3734893c3f572fc&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Foauth%2Finstagram&response_type=code
   final receipt
      it was: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Instagram</title>
        <meta name = "viewport" content = "width = 320px">
        <link rel="stylesheet" href="/static/styles/master-new.css?1" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>

    <div id="wrap" class="grid-all group">

<div style="width: 100%; margin: 0 auto;">
    <img style="margin-left: 0em; margin-top: 1.0em;" src="/static/images/headerWithTitle.png"><br/>
Sorry, this page could not be found.
</div>

    </div>
</body>
</html>

coolaj86 avatar Jul 16 '13 17:07 coolaj86

I’ll have to rerun this test, since that appears to be an Instagram 404 page.

mckelvey avatar Jul 28 '13 18:07 mckelvey