Commit 1a1fa27d authored by Rémy Decoupes's avatar Rémy Decoupes
Browse files

Add a work around about over tweets.jsonl: convert all single quote into double quote

parent dcdfe591
......@@ -51,3 +51,4 @@
2. Verify if kibana is working (and is connected to elasticsearch)
+ With your favorite browser connect to [Mood tetis kibana website](http://mo-mood-tetis-tweets-collect.montpellier.irstea.priv:5601/app/home#/)
+ Create an index pattern through Analytics > Discover
3. Edit tweets jsonl file: transform the single quote to double quote: `python3 elasticsearch/src/fix_bad_quote_json.py`
# from https://gist.github.com/mbrzusto/23fe728966247f25f3ec
import json
import ast
fr = open("/home/rdecoupe/mood-tetis-tweets-collect/output/tweetoutput20200622-093342.jsonl")
fw = open("/home/rdecoupe/mood-tetis-tweets-collect/output.doublequote/tweetoutput20200622-093342.jsonl", "w")
for line in fr:
json_dat = json.dumps(ast.literal_eval(line))
dict_dat = json.loads(json_dat)
json.dump(dict_dat, fw)
fw.write("\n")
fw.close()
fr.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment