EmailHarvester icon indicating copy to clipboard operation
EmailHarvester copied to clipboard

Code Improvements and Addition of New Features

Open Adriel007 opened this issue 10 months ago • 1 comments

Changes Documentation

1. Signal Handling Addition

  • Added a signal handler to capture the SIGINT signal (Ctrl+C) and cancel the email search if the user wishes to interrupt it.

2. clean_html_tags Method in myparser Class

  • The genericClean method was replaced by the clean_html_tags method in the myparser class. This was done to make the naming more descriptive and cohesive with the method's responsibility.

3. clean_special_characters Method in myparser Class

  • A new method called clean_special_characters was added to the myparser class. It is responsible for cleaning special characters from the results string, replacing them with whitespace.

4. Regex Change in emails Method of myparser Class

  • The regex in the emails method was modified to use "raw" strings (prefixed with r) to improve readability and avoid issues with backslashes in escape characters.

5. Exception Handling Addition in __init__ Method of EmailHarvester Class

  • Exception handling was added for plugin import and initialization. This ensures that any errors during these processes are captured and handled appropriately.

6. Redundant Exception Handling Removal

  • Some blocks of code containing redundant exception handling were removed. For example, the try-except block around the call to r.raise_for_status() in the do_search method of the EmailHarvester class was removed, as requests.get already raises a requests.exceptions.HTTPError exception if the response has an error status.

Adriel007 avatar Apr 14 '24 17:04 Adriel007