Adding fix for writing UTF-8 encoded strings when keeping tweet history

pull/7/head
Ayush Sharma 2019-04-30 21:25:18 +05:30
parent 646518ffe6
commit 91a325e937
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import helpers
import requests
from bs4 import BeautifulSoup
from pathlib import Path
import codecs
def getTweets():
@ -97,7 +98,7 @@ def tootTheTweet(tweet):
else:
tweet_check = open(tweet_check_file_path, 'w')
tweet_check = codecs.open(tweet_check_file_path, mode='w', encoding='utf-8')
tweet_check.write(tweet['text'])
tweet_check.close()