Insert the matched IP into the collection of positive results. This was done as an update because it was clear whether Censys would de-duplicate.
(entry, results_collection)
| 134 | |
| 135 | |
| 136 | def insert_result(entry, results_collection): |
| 137 | """ |
| 138 | Insert the matched IP into the collection of positive results. |
| 139 | This was done as an update because it was clear whether Censys would de-duplicate. |
| 140 | """ |
| 141 | entry["createdAt"] = datetime.utcnow() |
| 142 | results_collection.update_one({"ip": entry["ip"]}, entry, upsert=True) |
| 143 | |
| 144 | |
| 145 | def main(logger=None): |