Skip to content

Instantly share code, notes, and snippets.

@mbreese
Created July 12, 2023 06:10
Show Gist options
  • Save mbreese/159ab2b04fb05de81e3776827b63a73c to your computer and use it in GitHub Desktop.
Save mbreese/159ab2b04fb05de81e3776827b63a73c to your computer and use it in GitHub Desktop.
Bookmarklet to save web site URLs to a [usememos/memos] site. Replace $$OPENID_URL$$ with your OpenID URL/ID
javascript:function sendurl_to_memos(url,data){let xhr=new XMLHttpRequest();xhr.open("POST", url, true);xhr.setRequestHeader("Content-Type", "application/json");xhr.onreadystatechange=function(){if (xhr.readyState === 4) { if (xhr.status === 200) {alert("Saved!");}else{alert(xhr.readyState+"\n"+xhr.status+" error: "+this.responseText);}}};xhr.send(JSON.stringify(data));};sendurl_to_memos('$$OPENID_URL$$', {"content": document.title+"\n"+window.location.href+"\n#link"});
@mbreese
Copy link
Author

mbreese commented Jul 12, 2023

This is for use with the self-hosted webapp memos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment