avoid re-entrance problems

This commit is contained in:
cquest 2022-11-08 11:24:01 +01:00
parent fc049bae16
commit a858cd4608

View File

@ -146,6 +146,11 @@ if source[:4] == 'http':
sql.commit() sql.commit()
else: else:
try:
os.mkdir(source)
except:
pass
os.chdir(source)
subprocess.run('rm -f tweets.*json; twint -u %s -tl --limit 10 --json -o tweets.sjson; jq -s . tweets.sjson > tweets.json' % subprocess.run('rm -f tweets.*json; twint -u %s -tl --limit 10 --json -o tweets.sjson; jq -s . tweets.sjson > tweets.json' %
(source,), shell=True, capture_output=True) (source,), shell=True, capture_output=True)
d = json.load(open('tweets.json','r')) d = json.load(open('tweets.json','r'))