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

Updated args check, removed old args and defaults, updated elasticsearch

parent 2540fb48
...@@ -29,14 +29,14 @@ def check(args): ...@@ -29,14 +29,14 @@ def check(args):
if args.userid: if args.userid:
error("Contradicting Args", error("Contradicting Args",
"--userid and -u cannot be used together.") "--userid and -u cannot be used together.")
else:
if args.search is None:
error("Error", "Please use at least -u or -s.")
if args.output is None: if args.output is None:
if args.csv: if args.csv:
error("Error", "Please specify an output file (Example: -o file.csv).") error("Error", "Please specify an output file (Example: -o file.csv).")
elif args.json: elif args.json:
error("Error", "Please specify an output file (Example: -o file.json).") error("Error", "Please specify an output file (Example: -o file.json).")
if args.hostname:
if args.Database is None or args.DB_user is None or args.DB_pwd is None:
error("Error", "Please specify database name, user and password")
def loadUserList(ul, _type): def loadUserList(ul, _type):
""" Concatenate users """ Concatenate users
......
...@@ -2,7 +2,7 @@ class Config: ...@@ -2,7 +2,7 @@ class Config:
Username = None Username = None
User_id = None User_id = None
Search = None Search = None
Geo = None Geo = ""
Location = False Location = False
Near = None Near = None
Lang = None Lang = None
......
...@@ -242,9 +242,9 @@ def Tweet(Tweet, config): ...@@ -242,9 +242,9 @@ def Tweet(Tweet, config):
"near": config.Near "near": config.Near
} }
} }
if config.Near: if config.Near or config.Geo:
if not _is_near_def: if not _is_near_def:
_is_near_def = getLocation(config.Near, near=True) _is_near_def = getLocation(config.Near + config.Geo, near=True)
if _near: if _near:
j_data["_source"].update({"geo_near": _near}) j_data["_source"].update({"geo_near": _near})
if Tweet.place: if Tweet.place:
......
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