|
|
|
@ -2,6 +2,8 @@
|
|
|
|
|
Whois information lookup
|
|
|
|
|
- Fetches using whois
|
|
|
|
|
- Extends the 'text_json_diff' so that text filters can still be used with whois information
|
|
|
|
|
|
|
|
|
|
@todo publish to pypi and github as a separate plugin
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from ..plugins import hookimpl
|
|
|
|
@ -26,9 +28,12 @@ class text_json_filtering_whois(text_json_diff.perform_site_check):
|
|
|
|
|
w = whois.whois(parsed.hostname)
|
|
|
|
|
self.fetcher.content= w.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@hookimpl
|
|
|
|
|
def extra_processor():
|
|
|
|
|
"""
|
|
|
|
|
Advertise a new processor
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
from changedetectionio.processors import default_processor_config
|
|
|
|
|
processor_config = dict(default_processor_config)
|
|
|
|
|
# Which UI elements are not used
|
|
|
|
@ -37,9 +42,11 @@ def extra_processor():
|
|
|
|
|
processor_config['needs_visualselector'] = False
|
|
|
|
|
return ('plugin_processor_whois', "Whois domain information fetch", processor_config)
|
|
|
|
|
|
|
|
|
|
# @todo When a watch chooses this extra_process processor, the watch should ONLY use this one.
|
|
|
|
|
# (one watch can only have one extra_processor)
|
|
|
|
|
@hookimpl
|
|
|
|
|
def processor_call(processor_name, datastore, watch_uuid):
|
|
|
|
|
if processor_name == 'plugin_processor_whois':
|
|
|
|
|
if processor_name == 'plugin_processor_whois': # could be removed, see above note
|
|
|
|
|
x = text_json_filtering_whois(datastore=datastore, watch_uuid=watch_uuid)
|
|
|
|
|
return x
|
|
|
|
|
return None
|
|
|
|
|