-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.py
42 lines (33 loc) · 1.38 KB
/
main.py
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
from src.twitter_client import TwitterClient
import time
def main():
try:
# Twitter client oluştur
client = TwitterClient()
print("✅ Twitter hesabına bağlandı\n")
while True:
print("\nTwitter Bot Başlatılıyor...")
print("-" * 30)
print("1: Tweet gönder")
print("2: Çıkış")
print("-" * 30)
choice = input("\nHangi işlemi yapmak istersiniz? (1-2): ").strip()
if choice == "1":
tweet_text = input("\nGöndermek istediğiniz tweet'i yazın: ").strip()
if client.post_tweet(tweet_text):
print("\n✅ Tweet başarıyla gönderildi!")
else:
print("\n❌ Tweet gönderilemedi!")
elif choice == "2":
print("\n✅ Program sonlandırılıyor...")
break
else:
print("\n❌ Geçersiz seçim! Lütfen 1-2 arasında bir sayı girin.")
# Her işlemden sonra kısa bir bekleme
time.sleep(2)
except KeyboardInterrupt:
print("\n\n⚠️ Program kullanıcı tarafından sonlandırıldı.")
except Exception as e:
print(f"\n❌ Program hatası: {str(e)}")
if __name__ == "__main__":
main()