webpositive
webpositive

Reputation: 41

Scheduling posts using Tumblr API

I'd like to schedule my posts using Tumblr API. I can add posts to the queue but they're scheduled automatically and the given datetime in date field is completely ignored. I played with various time format strings but no luck.

from pytumblr import TumblrRestClient

client = TumblrRestClient(tumblr_consumer_key,
                          tumblr_consumer_secret,
                          tumblr_token,
                          tumblr_token_secret)

response = client.create_text('tumblr_blog_name', state='queue',
                              tags=tags, tweet=tweet,
                              format='html', date=date,
                              title=title, body=body)

I use PyTumblr version 0.0.6.

Is it not possible or did i miss something?

Upvotes: 1

Views: 677

Answers (1)

webpositive
webpositive

Reputation: 41

It can be done using field 'publish_on'.

Although it's not supported officially by the Python implementation (and it's not mentioned in the documentation) it's possible to use it with monkey patching the TumblrRestClient._post_valid_options method by adding the needed field.

if post_type == 'text':
    valid += ['title', 'body', 'publish_on']

Upvotes: 2

Related Questions