tumblr / pytumblr

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

Pytumblr ignores the tweet parameter #70

Closed houmie closed 9 years ago

houmie commented 9 years ago

I have the following code to post a blog on Tumblr through Tumblr API.

 post = client.create_text("xxx.tumblr.com",
                                      state="published",
                                      tags=utag_list,
                                      format='html',
                                      tweet=tweet.encode('utf-8'),
                                      slug=sluged_header,
                                      title=news.head_line.encode('utf-8'),
                                      body=body)
Strangely the tweet parameter doesnt do anything.

Looking at my blog source, I can see:

<li><a href="https://twitter.com/intent/tweet?text=Teenagers%20rescue%20elderly%20couple%20from%20sinking%20after%20car%20crashes%20into%20lake%20-%20Teenage%20wind-surfing...%20http%3A%2F%2Ftmblr.co%2FZ_F3uj1qlCL9u" class="share-item twitter" target="_blank">Tweet</a></li>

This is the default tweet message generated. Somehow my custom tweet message is completely ignored. And not generated in source. Hence the tweet sharing doesn't see the custom message. Any advice please?

ceyko commented 9 years ago

Are you able to crosspost to twitter on tumblr.com? In a minimal example I've constructed, I am not able to replicate the issue. It crossposts with the supplied tweet:

client.create_text(
    'name.tumblr.com', 
    body='Some text',
    tweet='A custom tweet: [URL]'
)

Which outputs the following on the linked twitter account:

A custom tweet: http://tmblr.co/ABCD
houmie commented 9 years ago

Thanks for your reply. The Crosspost to twitter was active But I found the problem. My Tweet was slightly bigger than 140 chars and hence the tweet was ignored and not shown. I wished there was a kind of an error raised instead.

ceyko commented 9 years ago

@houmie Good find, thanks for the reproduction case! It seems like it's a backend issue, not specifically with this client though, so I'm closing this issue and will file a bug internally.