sourcecache module includes the metadata config.

pull/2/head
Alexandre Dulaunoy 2016-03-16 20:02:03 +01:00
parent 4231cf1f6f
commit c469681b68
1 changed files with 6 additions and 1 deletions

View File

@ -4,13 +4,17 @@ from url_archiver import url_archiver
misperrors = {'error': 'Error'}
mispattributes = {'input': ['link'], 'output': ['link']}
moduleinfo = {'version': '0.1', 'author': 'Alexandre Dulaunoy', 'description': 'Module to cache web pages of analysis reports, OSINT sources. The module returns a link of the cached page.'}
archive_path = '/tmp/'
moduleconfig = ['archivepath']
def handler(q=False):
if q is False:
return False
request = json.loads(q)
if (request.get('config')):
archive_path = request['config']['archivepath']
else:
archive_path = '/tmp/'
if request.get('link'):
tocache = request['link']
archiver = url_archiver.Archive(archive_path=archive_path)
@ -28,4 +32,5 @@ def introspection():
def version():
moduleinfo['config'] = moduleconfig
return moduleinfo