Skip to content

Instantly share code, notes, and snippets.

@scoumbourdis
Created June 22, 2022 05:30
Show Gist options
  • Save scoumbourdis/b30b07620f94a4e973e5a6720a583943 to your computer and use it in GitHub Desktop.
Save scoumbourdis/b30b07620f94a4e973e5a6720a583943 to your computer and use it in GitHub Desktop.
# Tweet Message "To send this tweet* I’ve used only Github Copilot suggestions with a programming language I am not familiar with 😮\n\n*through twitter API"
twitterMessage = "To send this tweet* I’ve used only Github Copilot suggestions with a programming language I am not familiar with 😮\n\n*through twitter API"
# post tweet to twitter
import tweepy
import os
# send tweet
def send_tweet(message):
# Twitter API credentials
consumer_key = os.environ.get('TWITTER_CONSUMER_KEY')
consumer_secret = os.environ.get('TWITTER_CONSUMER_SECRET')
access_token = os.environ.get('TWITTER_ACCESS_TOKEN')
access_token_secret = os.environ.get('TWITTER_ACCESS_TOKEN_SECRET')
# Authentication
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
# Send the tweet
api.update_status(message)
send_tweet(twitterMessage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment