Update README.md

This commit is contained in:
Akash
2020-07-18 08:26:17 +05:30
committed by GitHub
parent cc75a7e177
commit a8604f5aa0

View File

@@ -66,25 +66,21 @@ This should print an URL similar to the following archived URL:
> <https://web.archive.org/web/20200504141153/https://github.com/akamhy/waybackpy> > <https://web.archive.org/web/20200504141153/https://github.com/akamhy/waybackpy>
#### Receiving the oldest archive for an URL Using oldest() #### Receiving the oldest archive for an URL Using oldest()
```diff
+ waybackpy.oldest(url, UA=user_agent)
```
> url is mandatory. UA is not, but highly recommended.
```python ```python
import waybackpy import waybackpy
# retrieving the oldest archive on Wayback machine. # retrieving the oldest archive on Wayback machine.
# Default user_agent is "waybackpy python package". # Default user_agent is "waybackpy python package".
oldest_archive = waybackpy.oldest("https://www.google.com/", UA = "Any-User-Agent") target_url = waybackpy.Url("https://www.google.com/", user_agnet="My-cool-user-agent")
oldest_archive = target_url.oldest()
print(oldest_archive) print(oldest_archive)
``` ```
This returns the oldest available archive for <https://google.com>. This returns the oldest available archive for <https://google.com>.
> <http://web.archive.org/web/19981111184551/http://google.com:80/> > <http://web.archive.org/web/19981111184551/http://google.com:80/>
#### Receiving the newest archive for an URL using newest() #### Receiving the newest archive for an URL using newest()
> url is mandatory. UA is not, but highly recommended. > url is mandatory. UA is not, but highly recommended.