Sto cercando di modificare alcuni post nel mio blog tumblr utilizzando PyTumblr e edit_post function, ma non riesco a capire esattamente quali parametri sono necessari. Provo a mettere il parametro tags ma non è accettato.Come posso usare la funzione edit_post in PyTumblr?
Ho provato questo:
client = pytumblr.TumblrRestClient(CONSUMER_KEY, CONSUMER_SECRET,
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
client.edit_post('nameofblog', {'id': 39228373})
e mi dà il seguente errore:
TypeError: edit_post() takes exactly 2 arguments (3 given)
Tutte le idee?
Questa è la funzione:
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)
Esattamente cosa hai provato a passare come parametro (e non ha funzionato)? –
Prima di tutto, non vedo dove metto l'id del post che voglio. – GiannisIordanou