<commit_before>#!/usr/bin/python
   
#EmailtoHIBP.py
#Author: <NAME> - @Sudhanshu_C
     
#This Script will retrieve the Domain(s) at which the specified account has been compromised
#It uses the API provided by https://haveibeenpwned.com/
#Special Thanks to Troy Hunt - http://www.troyhunt.com/
#For MaltegoTransform library and Installation guidelines go to http://www.paterva.com/web6/documentation/developer-local.php

import sys  # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#imports
import urllib2

from MaltegoTransform import *

HIBP = "https://haveibeenpwned.com/api/breachedaccount/" # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#constants

mt = MaltegoTransform()
mt.parseArguments(sys.argv)
email = mt.getValue()  # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#other-recommendations
mt = MaltegoTransform()
getrequrl = HIBP + email

try:
    response = urllib2.urlopen(getrequrl)
    for rep in response:
        mt.addEntity("maltego.Phrase","Pwned at " + rep)

except:
        print ""
        
mt.returnOutput()<commit_msg>Fix JSON<commit_after>#!/usr/bin/python
   
#EmailtoHIBP.py
#Author: <NAME> - @Sudhanshu_C
     
#This Script will retrieve the Domain(s) at which the specified account has been compromised
#It uses the API provided by https://haveibeenpwned.com/
#Special Thanks to Troy Hunt - http://www.troyhunt.com/
#For MaltegoTransform library and Installation guidelines go to http://www.paterva.com/web6/documentation/developer-local.php

import sys  # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#imports
import urllib2
import json

from MaltegoTransform import *

HIBP = "https://haveibeenpwned.com/api/breachedaccount/"  # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#constants

mt = MaltegoTransform()
mt.parseArguments(sys.argv)
email = mt.getValue()  # PEP 8 http://legacy.python.org/dev/peps/pep-0008/#other-recommendations
mt = MaltegoTransform()
getrequrl = HIBP + email

try:
    response = urllib2.urlopen(getrequrl)
    data = json.load(response)
    response = data
    for rep in response:
        mt.addEntity("maltego.Phrase","Pwned at " + rep)

except:
        print ""
        
mt.returnOutput()
{'fraction_non_alphanumeric': 0.12217611802674043, 'fraction_numerical': 0.016597510373443983, 'mean_word_length': 3.8654708520179373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5124369', 'n_tokens_mistral': 793, 'n_tokens_neox': 752, 'n_words': 170}