tumblr / pytumblr

A Python Tumblr API v2 Client
Apache License 2.0
723 stars 196 forks source link

Tweet string doesn't appear for draft photo posts #100

Open JPLeBreton opened 6 years ago

JPLeBreton commented 6 years ago

I've had a program that works properly for a good year or two now that recently (since August 17th) experienced a problem.

The program does some things to generate a few images, then creates a draft photo post with those images, some description text, and a tweet with some summary text. Up until August 16th, the tweet text came through fine and I could queue the draft post via tumblr's web UI - just to be clear this was the intended behavior.

After that date, the tweet text does not appear to show up in the draft properly on the web UI - when I view it, it's the same auto-generated-from-description-text tweet that any post gets, and the twitter post button isn't enabled by default whereas it was before.

Here's the part of my program's code that compiles the tweet string and submits the draft post: https://bitbucket.org/JPLeBreton/wadbot/src/default/wadbot2.py#wadbot2.py-304 The tumblr it posts to: http://wadbot.tumblr.com

Just to make sure my tumblr's twitter integration wasn't at fault, I manually added a tweet to a queued post and it posted successfully at 2pm today: https://twitter.com/wadinfo_txt

I realize this is a very specific issue so I'm happy to provide more info if needed. Thanks for the project!

jasonpenny commented 6 years ago

Can you distill this down into a set of steps and a code sample that shows the problem?

JPLeBreton commented 6 years ago

Okay, here's some minimal sample code that exhibits the problem:

import pytumblr

consumer_key = 'xxxxxxxxxxxxxxxxxxxxx'
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxx'
oauth_token = 'xxxxxxxxxxxxxxxxxxxxx'
oauth_secret = 'xxxxxxxxxxxxxxxxxxxxx'

client = pytumblr.TumblrRestClient(consumer_key, consumer_secret,
                                   oauth_token, oauth_secret)

post_tweet = 'Hello! Custom tweet text.'
post = 'The full caption text of this photo post.'
img_filename = 'shot0.jpg'

client.create_photo('myblog', state="draft", tags=["mytag1", "mytag2"],
                    tweet=post_tweet, data=img_filename, caption=post)

With a valid oauth and blog name (substitute your own), this post successfully creates a draft photo post on my tumblr blog, but the tweet text reads "The full caption text of this photo post" instead of "Hello! Custom tweet text".

ryanfb commented 6 years ago

I see this as well using the sample code, no matter what the post type is. I also used the code here to check the HTTP requests being made and they preserve the tweet parameter. I also tried the same thing using Ruby's tumblr_client gem:

#!/usr/bin/env ruby
require 'tumblr_client'

Tumblr.configure do |config|
  config.consumer_key = 'xxxxxxxxxxxxxxxxxxxxx'
  config.consumer_secret = 'xxxxxxxxxxxxxxxxxxxxx'
  config.oauth_token = 'xxxxxxxxxxxxxxxxxxxxx'
  config.oauth_token_secret = 'xxxxxxxxxxxxxxxxxxxxx'
end

client = Tumblr::Client.new

client.text('myblog', {:body => 'Ruby tumblr_client test body', :state => 'draft', :tweet => 'Custom tweet text'})

And saw the same behavior: guemnjrl

So this seems to be a problem with the Tumblr API. I've written to api@tumblr.com describing the problem and linking back to this issue.

JPLeBreton commented 4 years ago

Just checking in ~3 years later in case anyone with any power to fix this is following this issue, which still occurs as described. I wrote to api@tumblr.com in reference to this issue just in case that's a better way to get support now.

cyle commented 4 years ago

Hey @JPLeBreton -- if this is something you can reproduce in an API request across multiple clients then hitting up the API docs repo issues is your best bet right now https://github.com/tumblr/docs/issues

JPLeBreton commented 4 years ago

Thanks! I'll file an issue there.