<commit_before># -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name:         sfp_creditcard
# Purpose:      Example module to use for new modules.
#
# Author:      <NAME> <<EMAIL>>
#
# Created:     21/04/2020
# Copyright:   (c) <NAME>
# Licence:     GPL
# -------------------------------------------------------------------------------

from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent

class sfp_creditcard(SpiderFootPlugin):

    """Credit Card Extractor:Footprint,Investigate,Passive:Content Analysis::Identify Credit Card Numbers in any data"""

    # Default options.
     opts = {
         # Options specific to this module
    }

    # Option descriptions.
    optdescs = {
    }

    # Tracking results can be helpful to avoid reporting/processing duplicates
    results = None

    # Tracking the error state of the module can be useful to detect when a third party
    # has failed and you don't wish to process any more events.
    errorState = False

    def setup(self, sfc, userOpts=dict()):
        self.sf = sfc
        # Krishnasis - Note : What does self.tempStorage() return ?
        self.results = self.tempStorage()

        # Clear / reset any other class member variables here
        # or you risk them persisting between threads.

        for opt in list(userOpts.keys()):
            self.opts[opt] = userOpts[opt]

    # What events is this module interested in for input
    # For a list of all events, check sfdb.py.
    def watchedEvents(self):
        return ["TARGET_WEB_CONTENT"]

    # What events this module produces
    def producedEvents(self):
        return ["CREDIT_CARD_NUMBER"]

    # Handle events sent to this module
    def handleEvent(self, event):
        eventName = event.eventType
        srcModuleName = event.module
        eventData = event.data
        
        event.moduleDataSource="Target Website"

        # Once we are in this state, return immediately.
        if self.errorState:
            return None

        # event was received.
        self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
<commit_msg>Fixed indentation problem<commit_after># -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name:         sfp_creditcard
# Purpose:      Example module to use for new modules.
#
# Author:      <NAME> <<EMAIL>>
#
# Created:     21/04/2020
# Copyright:   (c) <NAME>
# Licence:     GPL
# -------------------------------------------------------------------------------

from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent

class sfp_creditcard(SpiderFootPlugin):

    """Credit Card Extractor:Footprint,Investigate,Passive:Content Analysis::Identify Credit Card Numbers in any data"""

    # Default options.
    opts = {
         # Options specific to this module
    }

    # Option descriptions.
    optdescs = {
    }

    # Tracking results can be helpful to avoid reporting/processing duplicates
    results = None

    # Tracking the error state of the module can be useful to detect when a third party
    # has failed and you don't wish to process any more events.
    errorState = False

    def setup(self, sfc, userOpts=dict()):
        self.sf = sfc
        # Krishnasis - Note : What does self.tempStorage() return ?
        self.results = self.tempStorage()

        # Clear / reset any other class member variables here
        # or you risk them persisting between threads.

        for opt in list(userOpts.keys()):
            self.opts[opt] = userOpts[opt]

    # What events is this module interested in for input
    # For a list of all events, check sfdb.py.
    def watchedEvents(self):
        return ["TARGET_WEB_CONTENT"]

    # What events this module produces
    def producedEvents(self):
        return ["CREDIT_CARD_NUMBER"]

    # Handle events sent to this module
    def handleEvent(self, event):
        eventName = event.eventType
        srcModuleName = event.module
        eventData = event.data

        event.moduleDataSource="Target Website"

        # Once we are in this state, return immediately.
        if self.errorState:
            return None

        # event was received.
        self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)

{'fraction_non_alphanumeric': 0.15118690942613505, 'fraction_numerical': 0.004148421295229315, 'mean_word_length': 1.9807692307692308, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6686644', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1093, 'n_words': 390}