From c05dbd9abfb46dd7d0415b7c8dd346028ad0f4d9 Mon Sep 17 00:00:00 2001 From: Cory Kennedy Date: Wed, 3 Feb 2016 09:08:08 -0600 Subject: [PATCH] Added example script to all write all domains in CRITs to a text file. --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index dd38363..9c0fa7a 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,27 @@ crits = pycrits('http://localhost:8000', 'wxs', '') params = {'c-size__gte': 1024 * 1024} print(crits.sample_count(params=params)) ``` + +Here is an example of using crits.domains to query mongodb and write all domains to a text file. + +``` +from pycrits import pycrits +from datetime import datetime +import requests +import sys + +crits = pycrits('Your CRITS server', 'CRITS USERNAME', 'API KEY') +rundate = datetime.now().strftime('-%H%M-%m-%d-%y') +sys.stdout = open("results" +".txt", "w") + + +# Disables SSL verification. +# Accepts [True, False, and path to certificate file] +crits.verify = False + +# Supresses SSL certification verification +requests.packages.urllib3.disable_warnings() + +for obj in crits.domains(): + print obj['domain'] +```