Update README.md
This commit is contained in:
39
README.md
39
README.md
@@ -56,10 +56,15 @@ pip install waybackpy
|
|||||||
#### Capturing aka Saving an url using save()
|
#### Capturing aka Saving an url using save()
|
||||||
```python
|
```python
|
||||||
import waybackpy
|
import waybackpy
|
||||||
# Capturing a new archive on Wayback machine.
|
|
||||||
target_url = waybackpy.Url(url="https://github.com/akamhy/waybackpy", user_agent="My-cool-user-agent")
|
new_archive_url = waybackpy.Url(
|
||||||
archived_url = target_url.save()
|
|
||||||
print(archived_url)
|
url = "https://en.wikipedia.org/wiki/Multivariable_calculus",
|
||||||
|
user_agent = "Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0"
|
||||||
|
|
||||||
|
).save()
|
||||||
|
|
||||||
|
print(new_archive_url)
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
https://web.archive.org/web/20200504141153/https://github.com/akamhy/waybackpy
|
https://web.archive.org/web/20200504141153/https://github.com/akamhy/waybackpy
|
||||||
@@ -71,10 +76,15 @@ 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()
|
||||||
```python
|
```python
|
||||||
import waybackpy
|
import waybackpy
|
||||||
# retrieving the oldest archive on Wayback machine.
|
|
||||||
target_url = waybackpy.Url("https://www.google.com/", "My-cool-user-agent")
|
oldest_archive_url = waybackpy.Url(
|
||||||
oldest_archive = target_url.oldest()
|
|
||||||
print(oldest_archive)
|
"https://www.google.com/",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:40.0) Gecko/20100101 Firefox/40.0"
|
||||||
|
|
||||||
|
).oldest()
|
||||||
|
|
||||||
|
print(oldest_archive_url)
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
http://web.archive.org/web/19981111184551/http://google.com:80/
|
http://web.archive.org/web/19981111184551/http://google.com:80/
|
||||||
@@ -86,10 +96,15 @@ 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()
|
||||||
```python
|
```python
|
||||||
import waybackpy
|
import waybackpy
|
||||||
# retrieving the newest/latest archive on Wayback machine.
|
|
||||||
target_url = waybackpy.Url(url="https://www.facebook.com/", user_agent="My-cool-user-agent")
|
newest_archive_url = waybackpy.Url(
|
||||||
newest_archive = target_url.newest()
|
|
||||||
print(newest_archive)
|
"https://www.facebook.com/",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0"
|
||||||
|
|
||||||
|
).newest()
|
||||||
|
|
||||||
|
print(newest_archive_url)
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
https://web.archive.org/web/20200714013225/https://www.facebook.com/
|
https://web.archive.org/web/20200714013225/https://www.facebook.com/
|
||||||
|
Reference in New Issue
Block a user