Commit 4baad9c9 authored by Francesco Poldi's avatar Francesco Poldi

Updated index and fixes

parent d4672ee0
......@@ -207,19 +207,17 @@ def main():
c = initialize(args)
if "likes" in str(args.es_count):
c.ES_count["likes"] = False
c.ES_count["likes"] = True
if "replies" in str(args.es_count):
c.ES_count["replies"] = False
c.ES_count["replies"] = True
if "retweets" in str(args.es_count):
c.ES_count["retweets"] = False
c.ES_count["retweets"] = True
if args.pandas_clean:
twint.storage.panda.clean()
c = initialize(args)
if args.favorites:
if args.userlist:
_userlist = loadUserList(args.userlist, "favorites")
......
......@@ -19,7 +19,11 @@ PUT twinttweets
"link": {"type": "text"},
"retweet": {"type": "text"},
"user_rt": {"type": "text"},
"essid": {"type": "keyword"}
"essid": {"type": "keyword"},
"nlikes": {"type": "integer"},
"nreplies": {"type": "integer"},
"nretweets": {"type": "integer"},
"search": {"type": "text"}
}
}
}
......
......@@ -49,8 +49,8 @@ class Config:
Media = False
Replies = False
Pandas_clean = True
ES_count = {"likes":True,"replies":True,"retweets":True}
Lowercase = False
ES_count = {"likes":False,"replies":False,"retweets":False}
Lowercase = True
Pandas_au = True
Proxy_host = None
Proxy_port = 0
......
......@@ -68,12 +68,16 @@ def Tweet(Tweet, config):
"link": Tweet.link,
"retweet": Tweet.retweet,
"user_rt": Tweet.user_rt,
"essid": config.Essid
"essid": config.Essid,
"nlikes": int(Tweet.likes),
"nreplies": int(Tweet.replies),
"nretweets": int(Tweet.retweets),
"search": str(config.Search)
}
}
actions.append(j_data)
if config.ES_count["likes"] is not False:
if config.ES_count["likes"]:
for l in range(int(Tweet.likes)):
j_data = {
"_index": config.Index_tweets,
......@@ -100,7 +104,7 @@ def Tweet(Tweet, config):
actions.append(j_data)
nLikes += 1
if config.ES_count["replies"] is not False:
if config.ES_count["replies"]:
for rep in range(int(Tweet.replies)):
j_data = {
"_index": config.Index_tweets,
......@@ -127,7 +131,7 @@ def Tweet(Tweet, config):
actions.append(j_data)
nReplies += 1
if config.ES_count["retweets"] is not False:
if config.ES_count["retweets"]:
for ret in range(int(Tweet.retweets)):
j_data = {
"_index": config.Index_tweets,
......
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