Skip to content

Instantly share code, notes, and snippets.

@byrney
Last active March 25, 2021 03:05
Show Gist options
  • Save byrney/b21456682e77a0d51708 to your computer and use it in GitHub Desktop.
Save byrney/b21456682e77a0d51708 to your computer and use it in GitHub Desktop.
Bookmarklet for IOS that uses heckyeahmarkdown to convert current page to MD and then create as a note in IOS simplenote app
javascript:(function(){var request=new XMLHttpRequest();var p=document.createElement("p");p.innerHTML="<strong>Clip to Simplenote</strong>";p.style.padding="20px";p.style.background="#fa0";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";var st=document.createElement("p");p.appendChild(st);st.innerHTML="Converting...";document.body.appendChild(p);var url="http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=json&u="+encodeURIComponent(location.href);request.onreadystatechange=function(){if(request.readyState==4&&request.status==200){st.innerHTML="<strong>Clipping</strong>";var res=JSON.parse(request.responseText);var note=res.title+"\n\n"+res.content+"\n\n"+res.url;st.innerHTML="<strong>Opening Simplenote</strong>";location.href="simplenote://new?content="+encodeURIComponent(note)+"&tag=webclip";p.hidden=true;}};request.open("GET",url,true);request.send();})();
@byrney
Copy link
Author

byrney commented Oct 4, 2014

This lets me clip a webpage in markdown format to simplenote on my phone which I can then view in NvAlt on my mac.

Largely cribbed from Phillip Gruneich's Evernote clipper: http://philgr.com/blog/save-articles-from-the-web-on-evernote-from-ios which uses Brett's http://heckyesmarkdown.com/ API for the conversion.

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