Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oauth 按位置/时间戳获取instagram照片_Oauth_Python Requests_Instagram_Python 3.4_Instagram Api - Fatal编程技术网

Oauth 按位置/时间戳获取instagram照片

Oauth 按位置/时间戳获取instagram照片,oauth,python-requests,instagram,python-3.4,instagram-api,Oauth,Python Requests,Instagram,Python 3.4,Instagram Api,为此我构建了一个基本的Python函数,但它只返回空列表?我在网上看到了这个问题的其他答案,其中包括为API走出沙箱,但我不知道如何做到这一点?这不是一个应用程序或任何东西,它是一个小的测试脚本 脚本如下: def get_instagram_posts(name, time, coordinates): max_time_dt = time + timedelta(hours=3) min_time_dt = time - timedelta(hours=1) mil

为此我构建了一个基本的Python函数,但它只返回空列表?我在网上看到了这个问题的其他答案,其中包括为API走出沙箱,但我不知道如何做到这一点?这不是一个应用程序或任何东西,它是一个小的测试脚本

脚本如下:

def get_instagram_posts(name, time, coordinates):
    max_time_dt = time + timedelta(hours=3)
    min_time_dt = time - timedelta(hours=1)

    milli_max_time = int(calendar.timegm(max_time_dt.timetuple()))
    milli_min_time = int(calendar.timegm(min_time_dt.timetuple()))

    max_time = str(int(milli_max_time/1000))
    min_time = str(int(milli_min_time/1000))

    # Time has to be in seconds (no milliseconds).
    # See http://stackoverflow.com/questions/21091543/ajax-call-to-instagram-get-media-search-timestamp-issue

    dist_rad_str = str(insta_dist_radius_m)
    count_str = str(insta_count)

    api = InstagramAPI(access_token=insta_access_token, 
        client_secret=insta_client_secret)

    # https://www.instagram.com/developer/endpoints/media/

    r = api.media_search(name, count_str, str(coordinates[0]),
        str(coordinates[1]), min_time, max_time)

    print(r)
有没有办法做到这一点?(更改权限、更改查询、更改源API,我真的支持任何解决方案)


非常感谢您,我已经花了四个小时来处理这个查询了,什么都没有。

您无法在沙箱模式下获得结果,您必须使用API按照instagram用例和指南构建一个平台或应用程序,然后由instgram审核后才能上线。如果您不使用现有的应用程序来满足您的需求。

谢谢,情况似乎是这样的。。。碰巧知道有任何应用程序可以达到这个目的?非常感谢!!