我被所有这些层次的字典搞得很困惑,我必须深入了解它们,但我认为仅通过爬取数据可能更容易,然而我猜学习字典是一个好练习,一旦我弄清楚了,也许会更快。
我的代码如下,其中对 cposts 的赋值语句返回404:
但是 Python API 文档中说:client.posts('codingjester', **params) # 获取博客的帖子
这篇 Stack Overflow 帖子(Getting more than 50 notes with Tumblr API)说你应该使用 notes_info 来获取 notes。但我不知道如何在 Python 中构造它,而不是制作一个 URL。
我可以使用请求构造 URL,但我认为有一种更简单的方法,使用 Python/Tumblr API,只是我还没有想出来,如果有人能够解释一下,请告诉我。
我的代码如下,其中对 cposts 的赋值语句返回404:
import pytumblr
# Authenticate via OAuth
client = pytumblr.TumblrRestClient(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
)
f = client.followers('blog.tumblr.com')
users = f['users']
names = [b['name'] for b in f['users']]
print names
cposts = client.posts(names[0], 'notes_info=True')
print (cposts)
但是 Python API 文档中说:client.posts('codingjester', **params) # 获取博客的帖子
这篇 Stack Overflow 帖子(Getting more than 50 notes with Tumblr API)说你应该使用 notes_info 来获取 notes。但我不知道如何在 Python 中构造它,而不是制作一个 URL。
我可以使用请求构造 URL,但我认为有一种更简单的方法,使用 Python/Tumblr API,只是我还没有想出来,如果有人能够解释一下,请告诉我。
notes_info=True
е‘Ёе›өзљ„еҚ•еә•еЏ·еҺ»жҺ‰еђ—пәџењЁж€‘зњ‹жқӨпәЊе®ѓд»¬дәәд№ҺдёҚеғ”иҮӨењЁй‚Әй‡ЊгЂ‚ - wpercy