Spaces:
Runtime error
Runtime error
File size: 713 Bytes
c6dce0f ea13ed5 c6dce0f ea13ed5 c6dce0f ea13ed5 c6dce0f f1d29d4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import os
import string
import random
import tweepy
BEARER_TOKEN = os.environ.get("BEARER_TOKEN")
CONSUMER_KEY = os.environ.get("CONSUMER_KEY")
CONSUMER_SECRET = os.environ.get("CONSUMER_SECRET")
ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN")
ACCESS_TOKEN_SECRET = os.environ.get("ACCESS_TOKEN_SECRET")
client = tweepy.Client(
bearer_token=BEARER_TOKEN,
consumer_key=CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET,
access_token=ACCESS_TOKEN,
access_token_secret=ACCESS_TOKEN_SECRET,
)
length = 25
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length))
response = client.create_tweet(
text=result_str
)
print("Done!")
|