Update README.md

This commit is contained in:
Akash
2020-07-18 08:30:57 +05:30
committed by GitHub
parent 95010938a7
commit a4826e1954

View File

@@ -138,29 +138,24 @@ print(webpage)
> This should print the source code for <https://example.com/>. > This should print the source code for <https://example.com/>.
#### Count total archives for an URL using total_archives() #### 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 ```python
from waybackpy import total_archives from waybackpy import Url
# retriving the webpage from any url including the archived urls. Don't need to import other libraies :) # 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. # Default user-agent (UA) is "waybackpy python package", if not specified in the call.
# supported argumnets are url and UA # supported argumnets are url and UA
count = total_archives("https://en.wikipedia.org/wiki/Python (programming language)", UA="User-Agent") count = Url("https://en.wikipedia.org/wiki/Python (programming language)", "User-Agent").total_archives()
print(count) print(count)
``` ```
> This should print an integer (int), which is the number of total archives on archive.org > This should print an integer (int), which is the number of total archives on archive.org
## Tests ## Tests
* [Here](https://github.com/akamhy/waybackpy/tree/master/tests) * [Here](https://github.com/akamhy/waybackpy/tree/master/tests)
## Dependency ## Dependency
* None, just python standard libraries (json, urllib and datetime). Both python 2 and 3 are supported :) * None, just python standard libraries (json, urllib and datetime). Both python 2 and 3 are supported :)
## License ## License
[MIT License](https://github.com/akamhy/waybackpy/blob/master/LICENSE) [MIT License](https://github.com/akamhy/waybackpy/blob/master/LICENSE)