Merge pull request #37 from richs3c/main

Add Json output to spoofy
This commit is contained in:
Matt Keeley
2025-12-03 08:37:15 -07:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
import os
import pandas as pd
import json
from colorama import init, Fore, Style
# Initialize colorama
@@ -32,6 +33,14 @@ def write_to_excel(data, file_name="output.xlsx"):
else:
pd.DataFrame(data).to_excel(file_name, index=False)
def output_json(results):
output = []
for result in results:
output.append(result)
print(json.dumps(output))
def printer(**kwargs):
"""Utility function to print the results of DMARC, SPF, and BIMI checks in the original format."""

View File

@@ -107,7 +107,7 @@ def main():
parser.add_argument(
"-o",
type=str,
choices=["stdout", "xls"],
choices=["stdout", "xls", "json"],
default="stdout",
help="Output format: stdout or xls (default: stdout).",
)
@@ -115,6 +115,7 @@ def main():
"-t", type=int, default=4, help="Number of threads to use (default: 4)"
)
args = parser.parse_args()
if args.d:
@@ -142,6 +143,8 @@ def main():
if args.o == "xls" and results:
report.write_to_excel(results)
print("Results written to output.xlsx")
elif args.o == "json" and results:
report.output_json(results)
for _ in range(len(threads)):
domain_queue.put(None)