Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you post a tweet thread using this? #15

Open
a3igner opened this issue Jun 25, 2020 · 1 comment
Open

How do you post a tweet thread using this? #15

a3igner opened this issue Jun 25, 2020 · 1 comment

Comments

@a3igner
Copy link

a3igner commented Jun 25, 2020

Hi
Uploading a video works!
How could i post an attached tweet to the tweet i uploaded a video for to make a thread?
Thanks!

@pigeonburger
Copy link

pigeonburger commented Jan 13, 2021

Just adding another status update thingy in tweet(self):

def tweet(self):
    '''
    Publishes Tweet with attached video
    '''
    request_data = {
      'status': 'I just uploaded a video with the @TwitterAPI.',
      'media_ids': self.media_id
    }

    req = requests.post(url=POST_TWEET_URL, data=request_data, auth=oauth)
    print(req.json())
    
    thread_data = {
        'status': 'This tweet will be in reply to the video i just uploaded',
        'in_reply_to_status_id': req.json()['id'],
        'auto_populate_reply_metadata': True
    }

    req2 = requests.post(url=POST_TWEET_URL, data=thread_data, auth=oauth)
    print(req2.json())

Should work, I believe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants