通过 location/timestamp 获取 Instagram 照片
Getting instagram photos by location/timestamp
所以我为此构建了一个基本的 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
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 审核才能上线。如果不使用可以满足您需求的现有应用程序。
所以我为此构建了一个基本的 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
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 审核才能上线。如果不使用可以满足您需求的现有应用程序。