Not posting already posted tweets.

pull/7/head
Ayush Sharma 2019-02-28 13:29:08 +05:30
parent 4e6e5c4d85
commit 646518ffe6
1 changed files with 3 additions and 1 deletions

View File

@ -93,13 +93,15 @@ def tootTheTweet(tweet):
helpers._info('tootTheTweet() => Tweet ' + tweet_id + ' was already posted. Reposting...') helpers._info('tootTheTweet() => Tweet ' + tweet_id + ' was already posted. Reposting...')
return False
else: else:
tweet_check = open(tweet_check_file_path, 'w') tweet_check = open(tweet_check_file_path, 'w')
tweet_check.write(tweet['text']) tweet_check.write(tweet['text'])
tweet_check.close() tweet_check.close()
helpers._info('tootTheTweet() => New tweet ' + tweet_id + ' => "' + tweet['text'] + '".') helpers._info('tootTheTweet() => New tweet ' + tweet_id + ' => "' + tweet['text'] + '".')
response = requests.post( response = requests.post(
url=host_instance + '/api/v1/statuses', data=data, headers=headers) url=host_instance + '/api/v1/statuses', data=data, headers=headers)