Esempio n. 1
0
def main():
    if len(sys.argv) < 2:
        print 'Please, specify text file!'
        sys.exit(1)

    domains = IoSpyPy.file_get_contents(sys.argv[1])
    configs = ConfSpyPy.load('spypy.cfg')
    dataspypy = DataSpyPy(configs['host'], configs['port'])

    for domain in domains:
        doc = {
            'date': datetime.utcnow(),
            'domain': domain,
            'ip': '',
            'url': '',
            'title': '',
            'description': '',
            'keywords': [],
            'analytics': '',
            'adsense': '',
            'server': '',
            'hfields': {},
            'processed': 0
        }

        print 'Inserting domain: %s' % domain

        dataspypy.insert_record(doc)

    print 'Done'