Update README.md
This commit is contained in:
14
README.md
14
README.md
@@ -36,10 +36,10 @@ Using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)):
|
|||||||
```diff
|
```diff
|
||||||
+ waybackpy.save(url, UA=user_agent)
|
+ waybackpy.save(url, UA=user_agent)
|
||||||
```
|
```
|
||||||
> url is mandotory. UA is not, but higly recomended.
|
> url is mandatory. UA is not, but highly recommended.
|
||||||
```python
|
```python
|
||||||
import waybackpy
|
import waybackpy
|
||||||
# Capturing a new archive on wayback machine.
|
# Capturing a new archive on Wayback machine.
|
||||||
# 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.
|
||||||
archived_url = waybackpy.save("https://github.com/akamhy/waybackpy", UA = "Any-User-Agent")
|
archived_url = waybackpy.save("https://github.com/akamhy/waybackpy", UA = "Any-User-Agent")
|
||||||
print(archived_url)
|
print(archived_url)
|
||||||
@@ -53,7 +53,7 @@ This should print something similar to the following archived URL:
|
|||||||
```diff
|
```diff
|
||||||
+ waybackpy.oldest(url, UA=user_agent)
|
+ waybackpy.oldest(url, UA=user_agent)
|
||||||
```
|
```
|
||||||
> url is mandotory. UA is not, but higly recomended.
|
> url is mandatory. UA is not, but highly recommended.
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@@ -72,7 +72,7 @@ This returns the oldest available archive for <https://google.com>.
|
|||||||
```diff
|
```diff
|
||||||
+ waybackpy.newest(url, UA=user_agent)
|
+ waybackpy.newest(url, UA=user_agent)
|
||||||
```
|
```
|
||||||
> url is mandotory. UA is not, but higly recomended.
|
> url is mandatory. UA is not, but highly recommended.
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@@ -109,14 +109,14 @@ returns : <http://web.archive.org/web/20100504071154/http://www.facebook.com/>
|
|||||||
```waybackpy.near("https://www.oracle.com/index.html", year=2019, month=1, day=5, UA ="Any-User-Agent")``` returns: <http://web.archive.org/web/20190105054437/https://www.oracle.com/index.html>
|
```waybackpy.near("https://www.oracle.com/index.html", year=2019, month=1, day=5, UA ="Any-User-Agent")``` returns: <http://web.archive.org/web/20190105054437/https://www.oracle.com/index.html>
|
||||||
> Please note that if you only specify the year, the current month and day are default arguments for month and day respectively. Do not expect just putting the year parameter would return the archive closer to January but the current month you are using the package. If you are using it in July 2018 and let's say you use ```waybackpy.near("https://www.facebook.com/", year=2011, UA ="Any-User-Agent")``` then you would be returned the nearest archive to July 2011 and not January 2011. You need to specify the month "1" for January.
|
> Please note that if you only specify the year, the current month and day are default arguments for month and day respectively. Do not expect just putting the year parameter would return the archive closer to January but the current month you are using the package. If you are using it in July 2018 and let's say you use ```waybackpy.near("https://www.facebook.com/", year=2011, UA ="Any-User-Agent")``` then you would be returned the nearest archive to July 2011 and not January 2011. You need to specify the month "1" for January.
|
||||||
|
|
||||||
> Do not pad (don't use zeros in month, year, day, minute and hour arguments). e.g. For January, set month = 1 and not month = 01.
|
> Do not pad (don't use zeros in the month, year, day, minute, and hour arguments). e.g. For January, set month = 1 and not month = 01.
|
||||||
|
|
||||||
#### Get the content of webpage using get().
|
#### Get the content of webpage using get().
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
+ waybackpy.get(url, encoding="UTF-8", UA=user_agent)
|
+ waybackpy.get(url, encoding="UTF-8", UA=user_agent)
|
||||||
```
|
```
|
||||||
> url is mandotory. UA is not, but higly recomended. encoding is detected automatically, don't specify unless necessary.
|
> url is mandatory. UA is not, but highly recommended. encoding is detected automatically, don't specify unless necessary.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from waybackpy import get
|
from waybackpy import get
|
||||||
@@ -184,7 +184,7 @@ print(webpage)
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Dependency
|
## Dependency
|
||||||
* None, just python standard libraies. Both python 2 and 3 are supported. :)
|
* None, just python standard libraries. Both python 2 and 3 are supported :)
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
Reference in New Issue
Block a user