From a8ac67cf00b3d752a598600d60461ce7c1a1378e Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Wed, 11 Jan 2023 07:48:11 +0100 Subject: [PATCH] chg: [providence] output JSON --- bin/providence.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/providence.py b/bin/providence.py index d996a98..4fd5cdf 100644 --- a/bin/providence.py +++ b/bin/providence.py @@ -4,6 +4,7 @@ import argparse from pathlib import Path import os import re +import orjson import requests @@ -20,6 +21,7 @@ parser.add_argument( type=str, help="Limit to a specific TLD (if not, all known TLDs are tested)", ) +#parser.add_argument("","") args = parser.parse_args() @@ -65,15 +67,23 @@ results = set() if re.search(r' {1,}', args.name): # replace with - name = args.name + reversed_name = " ".join(args.name.split(" ")[::-1]) p = name.replace(" ", "-") results.update(guess_name(name=p, tlds=tlds)) - # combined + p = reversed_name.replace(" ", "-") + results.update(guess_name(name=p, tlds=tlds)) p = name.replace(" ", "") results.update(guess_name(name=p, tlds=tlds)) + p = reversed_name.replace(" ", "") + results.update(guess_name(name=p, tlds=tlds)) # try with removal of word for word in args.name.split(" "): results.update(guess_name(name=word, tlds=tlds)) else: results.update(guess_name(name=args.name, tlds=tlds)) -print(results) +output = {} +output['results'] = list(results) +j = orjson.dumps(output).decode() + +print(j)