Debian Codegraph @

examples/search/view_host_diff.py

raw
1 """View Host Diff."""
2
3 from datetime import date
4
5 from censys.search import CensysHosts
6
7 h = CensysHosts()
8
9 # Compare a single host between two timestamps
10 diff = h.view_host_diff("1.1.1.1", at_time=date(2022, 1, 1), at_time_b=date(2022, 1, 2))
11 print(diff)
12
13 # Compare a single host between its current timestamp and a timestamp
14 diff = h.view_host_diff("1.1.1.2", at_time=date(2022, 1, 2))
15 print(diff)
16
17 # Compare two hosts
18 diff = h.view_host_diff("1.1.1.1", ip_b="1.1.1.2")
19 print(diff)
20
21 # Compare two hosts between two timestamps
22 diff = h.view_host_diff(
23 ip="1.1.1.1",
24 ip_b="1.1.1.2",
25 at_time=date(2022, 1, 1),
26 at_time_b=date(2022, 1, 2),
27 )
28 print(diff)