question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update with media alternative way

See original GitHub issue

Hey! Does API.Update_with_media() works? I’m trying to reply tweets that have mentioned my profile, but isn’t work. My profile send the tweet with image, but not as a reply and just as a normal tweet.

If the method is deprecated, is there another way to reply tweets with a image?

def reply_tweet(tweet, message, img):
    api.update_with_media(img, message, in_reply_to_status_id = tweet.id)
    store_last_seen(FILE_NAME, tweet.id)
def main():
    tweets = api.mentions_timeline(read_last_seen(FILE_NAME), tweet_mode='extended')
    for tweet in reversed(tweets):
        message = generate_message()
        img = select_image_path()
        reply_tweet(tweet, message, img)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MichaelCurrincommented, May 23, 2020

If you try posting a reply without an image you’ll notice you’re still not making a reply. You need to follow tweepy docs for adding reply target ID and twitter docs which say you must also include a handle for it to become a reply

Example

https://michaelcurrin.github.io/python-twitter-guide/#/code_snippets?id=create-a-reply

1reaction
MichaelCurrincommented, Jul 1, 2020

Yes the deprecated method does work, as you’ve said it posts images and since my own app uses it

If you read the Tweepy docs you’ll see a note that it is deprecated and what the recommended alternative is.

The preferred approach is to use api.upload_media and then attach the returned ID as part of the media_ids list parameter on the api.update_status method

Here are my noted about that

https://michaelcurrin.github.io/python-twitter-guide/#/code_snippets?id=tweet-a-message-with-media

Read more comments on GitHub >

github_iconTop Results From Across the Web

71 Ways to Write a Social Media Update - Buffer
A deep dive into the specific ways to compose social media updates. Everything from capitalization, link placement, symbols, and more.
Read more >
How to Stay Up-To-Date With the Latest Social Media Changes
Another way to use Twitter to stay up-to-date is by finding social media influencers and then adding them to a list.
Read more >
26 Creative Ways to Publish Social Media Updates
Find 26 ways to publish updates on social media. ... Hashtagged events are popular and another good way to show your personality instead...
Read more >
7 Ways To Update Your Social Media Business Profiles
1. Get Rid of Old Posts · 2. Implement Your Brand Colors · 3. Update Your Profile Picture w/ a Professional Headshot ·...
Read more >
8 Types of Updates You Should Be Sharing With Your Social ...
They're the ultimate way to follow the concept that social media isn't a one-way medium meant for pushing content. It may seem frustrating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found