(no title)
giodamelio | 7 years ago
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);
});
Or minified to be copied directly into bookmark: javascript:fetch("https://outlineapi.com/parse_article?source_url="+encodeURIComponent(window.location)).then(o=>o.json()).then(o=>{if(o.error)return alert(`Outline Bookmarklet Error: ${o.error}`);window.location.href=`https://outline.com/${o.data.short_code}`}).catch(o=>{alert("Outline Bookmarklet Error. See console for details."),console.error(o)});
[1]: https://gist.github.com/giodamelio/c97f71a12eec5c142f21f757a...
No comments yet.