-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
22 lines (18 loc) · 875 Bytes
/
main.py
File metadata and controls
22 lines (18 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from functions import get_latest_tweet, loop_twitter_page, send_text, countdown, title
import undetected_chromedriver as uc
if __name__ == "__main__":
TWEET_XPATH = '/html/body/div[1]/div/div/div[2]/main/div/div/div/div[1]/div/div[3]/div/div/section/div/div/div[1]/div/div/article/div/div/div[2]/div[2]/div[2]/div/span'
while True:
title()
print("Starting...")
driver = uc.Chrome(headless=True)
driver.get("https://twitter.com/ChipotleTweets")
latest_tweet = get_latest_tweet(driver, TWEET_XPATH)
os.system("clear")
title()
code = loop_twitter_page(driver, TWEET_XPATH, latest_tweet)
resp = send_text(code)
driver.quit()
print(resp)
countdown()