diff options
authorRahiel Kasim <rahielkasim@gmail.com>2017-11-03 14:39:23 +0100
committerRahiel Kasim <rahielkasim@gmail.com>2017-11-03 14:39:23 +0100
commitd728f961fa9ab05e59a038f3f8bd1d674469e3d5 (patch)
parent95c14c50f0279fe79b4eca93cc7ab9918035df39 (diff)
add support for the perma.cc archive service
4 files changed, 28 insertions, 14 deletions
diff --git a/README.md b/README.md
index 400fe65..f374da2 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,7 @@
Archiveror is a browser extension that archives webpages by submitting them to
<https://archive.is>, <https://archive.org> and other archiving services. These
archives are publicly available, so you then have a backup that you can refer to
-in case the original falls prey to
-[link rot](https://en.wikipedia.org/wiki/Link_rot).
+in case the original falls prey to [link rot][].
Archiveror will also preserve your bookmarks by automatically archiving them in
the background. Its icon will change when you visit a bookmark it has archived,
@@ -22,6 +21,8 @@ for references and citations.
Happy archiving!
+[link rot]: https://en.wikipedia.org/wiki/Link_rot
## Archiving Services
Archiveror supports several online archiving service. You can choose which one
@@ -36,14 +37,20 @@ services to archive a single page in multiple web archives.
[robots.txt][robot] so it cannot archive all webpages. Links:
[FAQ][faq-archive.org], [Wikipedia][wiki-archive.org].
+- [**perma.cc**](https://perma.cc/), launched in 2013. Founded by the Harvard
+ Law School Library. Provides accounts to manage archived links. Free accounts
+ can create 10 archives per month. Links:
+ [Example](https://perma.cc/M8Q2-B8FY), [FAQ][faq-perma].
- [**webcitation.org**](http://www.webcitation.org), launched in 1997, respects
robots.txt. You need to set an email address at the options to use it. Has a
- focus on academic users. Links: [Example](http://www.webcitation.org/6guJcxnyr),
- [FAQ][faq-webcite], [Wikipedia][wiki-webcite].
+ focus on academic users. Links:
+ [Example](http://www.webcitation.org/6guJcxnyr), [FAQ][faq-webcite],
+ [Wikipedia][wiki-webcite].
[robot]: https://en.wikipedia.org/wiki/Robots_exclusion_standard
[faq-archive.is]: https://archive.is/faq
[faq-archive.org]: https://archive.org/about/faqs.php#The_Wayback_Machine
+[faq-perma]: https://perma.cc/docs/faq
[faq-webcite]: https://www.webcitation.org/faq
[wiki-archive.is]: https://en.wikipedia.org/wiki/Archive.is
[wiki-archive.org]: https://en.wikipedia.org/wiki/Internet_Archive
@@ -52,10 +59,9 @@ services to archive a single page in multiple web archives.
## Local Saving
Archiveror can also make local copies of webpages. One page will be saved in a
-single [MHTML](https://en.wikipedia.org/wiki/MHTML) file. Bookmarks will be
-saved automatically. Pages can also be manually saved by either clicking the
-button or pressing Ctrl+Shift+S. The filenames end with the UTC date and time of
-when the archive was made.
+single [MHTML][] file. Bookmarks will be saved automatically. Pages can also be
+manually saved by either clicking the button or pressing Ctrl+Shift+S. The
+filenames end with the UTC date and time of when the archive was made.
To enable local archiving, right click the Archiveror button, go to the options
and then pick "Local".
@@ -70,6 +76,7 @@ Local saving is currently only available for Chromium, vote
for [this bug][1261339] if you want this feature on Firefox. Alternatively
consider the [Mozilla Archive Format][maff] or [UnMHT][] add-ons.
+[MHTML]: https://en.wikipedia.org/wiki/MHTML
[1261339]: https://bugzilla.mozilla.org/show_bug.cgi?id=1261339
[maff]: https://addons.mozilla.org/firefox/addon/mozilla-archive-format/
[unmht]: https://addons.mozilla.org/firefox/addon/unmht/
@@ -85,8 +92,8 @@ consider the [Mozilla Archive Format][maff] or [UnMHT][] add-ons.
artist [sixsixfive](https://sixsixfive.deviantart.com/) and was generously
released into the public domain.
* This extension would not be possible without the free archiving services
- provided by <https://archive.is>, <https://archive.org> and
- <http://www.webcitation.org>.
+ provided by <https://archive.is>, <https://archive.org>, <https://perma.cc/>
+ and <http://www.webcitation.org>.
* The essay [Archiving URLs](https://www.gwern.net/Archiving-URLs) by Gwern
Branwen served as inspiration for this add-on.
diff --git a/src/archiveror.js b/src/archiveror.js
index 248ded5..813016a 100644
--- a/src/archiveror.js
+++ b/src/archiveror.js
@@ -45,7 +45,7 @@ function archivePage(url, services) {
- let re = /.*(?:archive|webcitation)\.(?:is|org).*/;
+ let re = /.*(?:archive|perma|webcitation)\.(?:is|cc|org).*/;
function url_to_clipboard(tab_id, changeInfo, tab) {
if (tab_id !== tabId) { // ignore other tabs
diff --git a/src/options.html b/src/options.html
index 341afd7..cd704d3 100644
--- a/src/options.html
+++ b/src/options.html
@@ -20,6 +20,11 @@
<a href="https://archive.org/web/">archive.org</a> (Wayback Machine)
+ <label for="perma.cc">
+ <input type="checkbox" name="service" id="perma.cc" value="perma.cc">
+ <a href="https://perma.cc/">perma.cc</a> (requires an account)
+ </label>
+ <br>
<label for="webcitation.org">
<input type="checkbox" name="service" id="webcitation.org" value="webcitation.org">
<a href="http://webcitation.org/">webcitation.org</a> (requires email, no HTTPS)
diff --git a/src/utils.js b/src/utils.js
index a88158d..16a07a8 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -1,4 +1,4 @@
-export const services = ["archive.is", "archive.org", "webcitation.org"];
+export const services = ["archive.is", "archive.org", "perma.cc", "webcitation.org"];
const blacklist = ["file://", "about:", "chrome://", "", "http://localhost"];
@@ -12,10 +12,12 @@ export function is_local(url) {
export function get_archiving_url(page, service, email) {
let url = "https://archive.is/?run=1&url=" + encodeURIComponent(page); // default
- if (service === "archive.org")
+ if (service === "archive.org") {
// breaks if page is URI encoded
url = "https://web.archive.org/save/" + page;
- else if (service === "webcitation.org") {
+ } else if (service === "perma.cc") {
+ url = "https://www.perma.cc/service/bookmarklet-create/?v=1&url=" + encodeURIComponent(page);
+ } else if (service === "webcitation.org") {
let base = "http://www.webcitation.org/archive?url=";
url = base + encodeURIComponent(page) + "&email=" + encodeURIComponent(email);