Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality for using savepagenow with authentication #45

Merged
merged 8 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/_build/doctrees/cli.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/exceptions.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/install.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/python.doctree
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2f383f7c7d760ebac68569bfb6f8f997
config: c2b4f9712704dbcd3ca7a8a9c5d4797e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file removed docs/_build/html/.doctrees/cli.doctree
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/contributing.doctree
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/exceptions.doctree
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/index.doctree
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/install.doctree
Binary file not shown.
Binary file removed docs/_build/html/.doctrees/python.doctree
Binary file not shown.
7 changes: 0 additions & 7 deletions docs/_build/html/_sources/contributing.md.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_build/html/_sources/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# savepagenow

A simple Python wrapper and command-line interface for archive.org’s "Save Page Now" capturing service
A simple Python wrapper and command-line interface for archive.org’s [“Save Page Now”](https://archive.org/web) capturing service

```{toctree}
:maxdepth: 1
Expand Down
17 changes: 14 additions & 3 deletions docs/_build/html/_sources/python.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,35 @@

# Python Usage

First import the library into your Python code.
## First import the library into your Python code.

```python
import savepagenow
```

Capture a URL.
## Capture a URL.

```python
archive_url = savepagenow.capture("http://www.example.com/")
```

See where it's stored.
## See where it's stored.

```python
print(archive_url)
```

## Capture a URL with authentication.

By default, savepagenow runs without authentication. This means that the tool can do four captures per minute.
If you'd like to run authenticated WayBack saves, which allows you to do 12 captures per minute,
set local environment variables ``access_key`` and ``secret`` to your [Internet Archive credentials](https://archive.org/account/s3.php).
Then, you can run capture() with the authenticate flag set to true like so:
```python
archive_url = savepagenow.capture("https://www.example.com/", authenticate=True)
```

## CachedPage Exception Handling
If a URL has been recently cached, archive.org may return the URL to that page rather than conduct a new capture. When that happens, the ``capture`` method will raise a ``CachedPage`` exception.

This is likely happen if you request the same URL twice within a few seconds.
Expand Down
6 changes: 4 additions & 2 deletions docs/_build/html/_static/alabaster.css
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ table.footnote td {
}

dl {
margin: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding: 0;
}

Expand Down Expand Up @@ -698,4 +700,4 @@ nav#breadcrumbs li+li:before {
div.related {
display: none;
}
}
}
57 changes: 27 additions & 30 deletions docs/_build/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -222,7 +222,7 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */

div.body {
min-width: 450px;
min-width: 360px;
max-width: 800px;
}

Expand All @@ -237,16 +237,6 @@ a.headerlink {
visibility: hidden;
}

a.brackets:before,
span.brackets > a:before{
content: "[";
}

a.brackets:after,
span.brackets > a:after {
content: "]";
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -335,12 +325,16 @@ p.sidebar-title {
font-weight: bold;
}

nav.contents,
aside.topic,
div.admonition, div.topic, blockquote {
clear: left;
}

/* -- topics ---------------------------------------------------------------- */

nav.contents,
aside.topic,
div.topic {
border: 1px solid #ccc;
padding: 7px;
Expand Down Expand Up @@ -379,13 +373,17 @@ div.body p.centered {

div.sidebar > :last-child,
aside.sidebar > :last-child,
nav.contents > :last-child,
aside.topic > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}

div.sidebar::after,
aside.sidebar::after,
nav.contents::after,
aside.topic::after,
div.topic::after,
div.admonition::after,
blockquote::after {
Expand Down Expand Up @@ -428,10 +426,6 @@ table.docutils td, table.docutils th {
border-bottom: 1px solid #aaa;
}

table.footnote td, table.footnote th {
border: 0 !important;
}

th {
text-align: left;
padding-right: 5px;
Expand Down Expand Up @@ -615,19 +609,26 @@ ul.simple p {
margin-bottom: 0;
}

dl.footnote > dt,
dl.citation > dt {
aside.footnote > span,
div.citation > span {
float: left;
margin-right: 0.5em;
}

dl.footnote > dd,
dl.citation > dd {
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}

dl.footnote > dd:after,
dl.citation > dd:after {
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}
Expand All @@ -644,10 +645,6 @@ dl.field-list > dt {
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}

dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
Expand Down Expand Up @@ -903,4 +900,4 @@ div.math:hover a.headerlink {
#top-link {
display: none;
}
}
}
Loading