Compare commits

...

5 Commits
2.1.0 ... 2.1.1

Author SHA1 Message Date
1a78d88be2 2.1.1 2020-07-19 23:17:01 +05:30
3ec61758b3 Update __version__.py 2020-07-19 23:16:13 +05:30
83c962166d Raise 2020-07-19 23:02:04 +05:30
e87dee3bdf Waybackpy example on replit (#15)
* Waybackpy save example on replit

* Oldest example

* Newest method replit link

* Near method example

* Get example

* Total archive method example
2020-07-19 22:28:08 +05:30
b27bfff15a v2.1.0 2020-07-19 21:08:01 +05:30
4 changed files with 10 additions and 10 deletions

View File

@ -69,7 +69,7 @@ print(new_archive_url)
```bash
https://web.archive.org/web/20200504141153/https://github.com/akamhy/waybackpy
```
<sub>Try this out in your browser @ <https://repl.it/repls/CompassionateRemoteOrigin#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPySaveExample></sub>
@ -89,7 +89,7 @@ print(oldest_archive_url)
```bash
http://web.archive.org/web/19981111184551/http://google.com:80/
```
<sub>Try this out in your browser @ <https://repl.it/repls/MixedSuperDimensions#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPyOldestExample></sub>
@ -109,7 +109,7 @@ print(newest_archive_url)
```bash
https://web.archive.org/web/20200714013225/https://www.facebook.com/
```
<sub>Try this out in your browser @ <https://repl.it/repls/OblongMiniInteger#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPyNewestExample></sub>
@ -161,7 +161,7 @@ https://web.archive.org/web/20180704090245/https://github.com/
<sub>The library doesn't supports seconds yet. You are encourged to create a PR ;)</sub>
<sub>Try this out in your browser @ <https://repl.it/repls/SparseDeadlySearchservice#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPyNearExample></sub>
@ -195,7 +195,7 @@ google_oldest_archive_source = waybackpy_url_object.get(
)
print(google_oldest_archive_source)
```
<sub>Try this out in your browser @ <https://repl.it/repls/PinkHoneydewNonagon#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPyGetExample#main.py></sub>
#### Count total archives for an URL using total_archives()
@ -216,7 +216,7 @@ print(archive_count) # total_archives() returns an int
```bash
2440
```
<sub>Try this out in your browser @ <https://repl.it/repls/DigitalUnconsciousNumbers#main.py></sub>
<sub>Try this out in your browser @ <https://repl.it/@akamhy/WaybackPyTotalArchivesExample></sub>
## Tests
* [Here](https://github.com/akamhy/waybackpy/tree/master/tests)

View File

@ -19,7 +19,7 @@ setup(
author = about['__author__'],
author_email = about['__author_email__'],
url = about['__url__'],
download_url = 'https://github.com/akamhy/waybackpy/archive/2.0.2.tar.gz',
download_url = 'https://github.com/akamhy/waybackpy/archive/2.1.1.tar.gz',
keywords = ['wayback', 'archive', 'archive website', 'wayback machine', 'Internet Archive'],
install_requires=[],
python_requires= ">=2.7",

View File

@ -3,7 +3,7 @@
__title__ = "waybackpy"
__description__ = "A Python library that interfaces with the Internet Archive's Wayback Machine API. Archive pages and retrieve archived pages easily."
__url__ = "https://akamhy.github.io/waybackpy/"
__version__ = "2.1.0"
__version__ = "2.1.1"
__author__ = "akamhy"
__author_email__ = "akash3pro@gmail.com"
__license__ = "MIT"

View File

@ -131,7 +131,7 @@ class Url():
try:
response = urlopen(req) #nosec
except Exception as e:
WaybackError(e)
raise WaybackError(e)
data = json.loads(response.read().decode("UTF-8"))
if not data["archived_snapshots"]:
@ -161,6 +161,6 @@ class Url():
try:
response = urlopen(req) #nosec
except Exception as e:
WaybackError(e)
raise WaybackError(e)
return str(response.read()).count(",") # Most efficient method to count number of archives (yet)