开发者

How can I loop this script every 30 seconds?

开发者 https://www.devze.com 2022-12-07 22:49 出处:网络
I want to loop this script every 30 seconds. tweets = tweepy.Cursor(api.search_tweets, q=\'safe dev\', lang=\'en\', tweet_m开发者_如何学Pythonode=\'extended\').items(100)

I want to loop this script every 30 seconds.

tweets = tweepy.Cursor(api.search_tweets, q='safe dev', lang='en', tweet_m开发者_如何学Pythonode='extended').items(100)
print(tweet.full_text, tweet.created_at)

I tried while true but it's not showing results.



import time 


for index in range(0 , to_numbers_of_loops):
    #here you can define the time you want to run the script in your case 30 seconds 
    time.sleep(30)
    tweets = tweepy.Cursor(api.search_tweets, q='safe dev', lang='en', tweet_mode='extended').items(100)
    print(tweet.full_text, tweet.created_at)


0

精彩评论

暂无评论...
验证码 换一张
取 消