我想用PyTumblr和edit_post function編輯我的tumblr博客中的一些帖子,但是我無法弄清楚需要什麼參數。我試着把標籤參數,但它不被接受。如何在PyTumblr中使用edit_post函數?
我已經試過這樣:
client = pytumblr.TumblrRestClient(CONSUMER_KEY, CONSUMER_SECRET,
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
client.edit_post('nameofblog', {'id': 39228373})
,它給我下面的錯誤:
TypeError: edit_post() takes exactly 2 arguments (3 given)
任何想法?
這是函數:
def edit_post(self, blogname, **kwargs):
"""
Edits a post with a given id
:param blogname: a string, the url of the blog you want to edit
:param tags: a list of tags that you want applied to the post
:param tweet: a string, the customized tweet that you want
:param date: a string, the GMT date and time of the post
:param format: a string, sets the format type of the post. html or markdown
:param slug: a string, a short text summary to the end of the post url
:returns: a dict created from the JSON response
"""
url = "/v2/blog/%s/post/edit" % blogname
return self.send_api_request('post', url, kwargs)
確切地說,你試圖通過什麼作爲參數(&它沒有工作)? –
首先,我不明白我在哪裏放置我想要的帖子的ID。 – GiannisIordanou