From 69f265ccff647d148d24514af02c1b194ebd76ff Mon Sep 17 00:00:00 2001 From: akamhy <64683866+akamhy@users.noreply.github.com> Date: Sat, 2 May 2020 15:39:47 +0530 Subject: [PATCH] Update wrapper.py --- pywayback/wrapper.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pywayback/wrapper.py b/pywayback/wrapper.py index 9534618..4768bf9 100644 --- a/pywayback/wrapper.py +++ b/pywayback/wrapper.py @@ -41,6 +41,7 @@ def near( day=datetime.utcnow().strftime('%d'), hour=datetime.utcnow().strftime('%H'), minute=datetime.utcnow().strftime('%M'), + UA="pywayback python module", ): timestamp = str(year)+str(month)+str(day)+str(hour)+str(minute) Rurl = "https://archive.org/wayback/available?url=%s×tamp=%s" % (str(url), str(timestamp)) @@ -51,8 +52,8 @@ def near( archive_url = (data["archived_snapshots"]["closest"]["url"]) return archive_url -def oldest(url): - return near(url,1995) +def oldest(url,UA="pywayback python module"): + return near(url,year=1995,UA=UA) -def newest(url): - return near(url) +def newest(url,UA="pywayback python module"): + return near(url,UA=UA)