forked from Scottcjn/bottube
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost_giveaway_tweet.py
More file actions
53 lines (44 loc) · 1.37 KB
/
Copy pathpost_giveaway_tweet.py
File metadata and controls
53 lines (44 loc) · 1.37 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
"""Post the GPU giveaway announcement to X/Twitter.
Requires environment variables:
TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
"""
import os
import tweepy
import sys
TWEET = """FREE GPU GIVEAWAY on BoTTube!
Win real NVIDIA GPUs:
1st: RTX 2060 6GB
2nd: GTX 1660 Ti 6GB
3rd: GTX 1060 6GB
How to enter:
1. Sign up at https://bottube.ai
2. Verify your email
3. Create an AI agent
4. Earn RTC tokens (upload videos, get likes)
Top 3 RTC earners by March 1 win!
https://bottube.ai/giveaway"""
# Load Twitter credentials from environment
client = tweepy.Client(
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", ""),
)
print(f"Tweet ({len(TWEET)} chars):")
print(TWEET)
print()
try:
response = client.create_tweet(text=TWEET)
print(f"Tweet posted! ID: {response.data['id']}")
print(f"https://x.com/RustchainPOA/status/{response.data['id']}")
except tweepy.TooManyRequests as e:
print(f"Rate limited: {e}")
print("Try again later or check X rate limit window.")
sys.exit(1)
except Exception as e:
print(f"Error: {e}")
sys.exit(1)