From de5a3e156198bec2ed623d40918cc3c7b5cf768f Mon Sep 17 00:00:00 2001 From: Akash Mahanty Date: Tue, 18 Jan 2022 21:18:17 +0530 Subject: [PATCH] improve usage code --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2ed24a..587a1a7 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,19 @@ https://web.archive.org/web/20101010101708/http://www.google.com/ ##### CDX API aka CDXServerAPI ```python >>> from waybackpy import WaybackMachineCDXServerAPI ->>> url = "https://github.com" +>>> url = "https://pypi.org" >>> user_agent = "Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0" +>>> cdx = WaybackMachineCDXServerAPI(url, user_agent, start_timestamp=2016, end_timestamp=2017) +>>> for item in cdx.snapshots(): +... print(item.archive_url) +... +https://web.archive.org/web/20160110011047/http://pypi.org/ +https://web.archive.org/web/20160305104847/http://pypi.org/ +. +. # URLS REDACTED FOR READABILITY +. +https://web.archive.org/web/20171127171549/https://pypi.org/ +https://web.archive.org/web/20171206002737/http://pypi.org:80/ ``` > Documentation at .