You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
445 B
Python

#!/usr/bin/env python3
import tweepy
from dotenv import load_dotenv
import os
import sys
load_dotenv()
# Authenticate to Twitter
auth = tweepy.OAuthHandler(os.getenv("APIKEY"), os.getenv("APISECRET"))
auth.set_access_token(os.getenv("TOKEN"), os.getenv("TOKENSECRET"))
# Create API object
api = tweepy.API(auth)
# Create a tweet
media = api.media_upload(sys.argv[1])
tweet = ""
api.update_status(status=tweet, media_ids=[media.media_id])