From ba46cdafe2c345f5c1af5f6c4912f77c7502f314 Mon Sep 17 00:00:00 2001 From: akamhy <64683866+akamhy@users.noreply.github.com> Date: Thu, 7 May 2020 15:12:37 +0530 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 28fff96..b220ab4 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,23 @@ print(webpage) ``` > This should print the source code for . +#### Count total archives for an url. Using total_archives() + +```diff ++ waybackpy.total_archives(url, UA=user_agent) +``` +> url is mandatory. UA is not, but highly recommended. + +```python +from waybackpy import total_archives +# retriving the webpage from any url including the archived urls. Don't need to import other libraies :) +# Default user-agent (UA) is "waybackpy python package", if not specified in the call. +# supported argumnets are url and UA +count = total_archives("https://en.wikipedia.org/wiki/Python (programming language)", UA="User-Agent") +print(count) +``` +> This should print an integer (int), which is the number of total archives on archive.org + ## Tests * [Here](https://github.com/akamhy/waybackpy/tree/master/tests)