Created
July 12, 2023 06:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is for use with the self-hosted webapp memos.