Skip to content

Instantly share code, notes, and snippets.

@ship9599
Forked from giodamelio/outline-bookmarklet.js
Last active June 16, 2019 05:19
Show Gist options
  • Save ship9599/59bf640d60c62b221bd427d2b3a0ef62 to your computer and use it in GitHub Desktop.
Save ship9599/59bf640d60c62b221bd427d2b3a0ef62 to your computer and use it in GitHub Desktop.

Revisions

  1. ship9599 revised this gist May 30, 2019. 1 changed file with 1 addition and 15 deletions.
    16 changes: 1 addition & 15 deletions outline-bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -1,15 +1 @@
    fetch(
    "https://outlineapi.com/parse_article?source_url=" +
    encodeURIComponent(window.location)
    )
    .then(res => res.json())
    .then(body => {
    if (body.error) {
    return alert(`Outline Bookmarklet Error: ${body.error}`);
    }
    window.location.href = `https://outline.com/${body.data.short_code}`
    })
    .catch(err => {
    alert("Outline Bookmarklet Error. See console for details.");
    console.error(err);
    });
    javascript:(function()%7Bwindow.location.href %3D 'https%3A%2F%2Foutline.com%2F' %2B window.location.href%7D)()
  2. @giodamelio giodamelio revised this gist Sep 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion outline-bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    fetch(
    "https://outlineapi.com/parse_article?source_url=" +
    encodeURI(window.location)
    encodeURIComponent(window.location)
    )
    .then(res => res.json())
    .then(body => {
  3. @giodamelio giodamelio created this gist Sep 22, 2018.
    15 changes: 15 additions & 0 deletions outline-bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    fetch(
    "https://outlineapi.com/parse_article?source_url=" +
    encodeURI(window.location)
    )
    .then(res => res.json())
    .then(body => {
    if (body.error) {
    return alert(`Outline Bookmarklet Error: ${body.error}`);
    }
    window.location.href = `https://outline.com/${body.data.short_code}`
    })
    .catch(err => {
    alert("Outline Bookmarklet Error. See console for details.");
    console.error(err);
    });