mirror of
https://github.com/sherlock-project/sherlock
synced 2024-11-15 08:47:08 +00:00
added browse functionality to notify.py
This commit is contained in:
parent
8a75dcff4b
commit
e6eef99e09
1 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@ results of queries.
|
||||||
"""
|
"""
|
||||||
from result import QueryStatus
|
from result import QueryStatus
|
||||||
from colorama import Fore, Style
|
from colorama import Fore, Style
|
||||||
|
import webbrowser
|
||||||
globvar = 0 # global variable to count the number of results.
|
globvar = 0 # global variable to count the number of results.
|
||||||
|
|
||||||
class QueryNotify:
|
class QueryNotify:
|
||||||
|
@ -109,7 +110,7 @@ class QueryNotifyPrint(QueryNotify):
|
||||||
Query notify class that prints results.
|
Query notify class that prints results.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, result=None, verbose=False, print_all=False):
|
def __init__(self, result=None, verbose=False, print_all=False, browse=False):
|
||||||
"""Create Query Notify Print Object.
|
"""Create Query Notify Print Object.
|
||||||
|
|
||||||
Contains information about a specific method of notifying the results
|
Contains information about a specific method of notifying the results
|
||||||
|
@ -121,6 +122,7 @@ class QueryNotifyPrint(QueryNotify):
|
||||||
results for this query.
|
results for this query.
|
||||||
verbose -- Boolean indicating whether to give verbose output.
|
verbose -- Boolean indicating whether to give verbose output.
|
||||||
print_all -- Boolean indicating whether to only print all sites, including not found.
|
print_all -- Boolean indicating whether to only print all sites, including not found.
|
||||||
|
browse -- Boolean indicating whether to open found sites in a web browser.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
Nothing.
|
Nothing.
|
||||||
|
@ -129,6 +131,7 @@ class QueryNotifyPrint(QueryNotify):
|
||||||
super().__init__(result)
|
super().__init__(result)
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
self.print_all = print_all
|
self.print_all = print_all
|
||||||
|
self.browse = browse
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -228,6 +231,8 @@ class QueryNotifyPrint(QueryNotify):
|
||||||
f" {self.result.site_name}: " +
|
f" {self.result.site_name}: " +
|
||||||
Style.RESET_ALL +
|
Style.RESET_ALL +
|
||||||
f"{self.result.site_url_user}")
|
f"{self.result.site_url_user}")
|
||||||
|
if self.browse:
|
||||||
|
webbrowser.open(self.result.site_url_user,2)
|
||||||
|
|
||||||
elif result.status == QueryStatus.AVAILABLE:
|
elif result.status == QueryStatus.AVAILABLE:
|
||||||
if self.print_all:
|
if self.print_all:
|
||||||
|
|
Loading…
Reference in a new issue