python-instagram example(404)无法解析响应,无效JSON

时间:2016-04-20 08:18:26

标签: python json instagram-api

以下是instagram无效的示例。 我找到this page但它没有解决我的问题,安装了python-instagram并且文件名正常。问题出在哪里?

angular.module('myapp',[]).controller("ctrl", function($scope){
$scope.reportingOptions=[{'code':'text','itemVal':'TEXT','disable':false}, {'code':'csv','itemVal':'CSV','disable':true}, {'code':'pdf','itemVal':'PDF','disable':false}];})

问题在于api.media_popular。

错误:

from instagram.client import InstagramAPI
api = InstagramAPI(client_id='xxx',
               client_secret='xxx')
popular_media = api.media_popular(count=20)

1 个答案:

答案 0 :(得分:0)

尝试python-instagram lib readme中的此代码:

from instagram.client import InstagramAPI

access_token = "YOUR_ACCESS_TOKEN"
client_secret = "YOUR_CLIENT_SECRET"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
recent_media, next_ = api.user_recent_media(user_id="userid", count=10)
for media in recent_media:
   print media.caption.text

并且popular_media:

api.media_popular(count, max_id)

更多信息在这里"图书馆"标签:https://www.instagram.com/developer/libraries/