Bookmarklet for IOS that uses heckyeahmarkdown to convert current page to MD and then create as a note in IOS simplenote app

October 5, 2014 ยท View on GitHub

javascript:(function(){var request=new XMLHttpRequest();var p=document.createElement("p");p.innerHTML="Clip to Simplenote";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="Clipping";var res=JSON.parse(request.responseText);var note=res.title+"\n\n"+res.content+"\n\n"+res.url;st.innerHTML="Opening Simplenote";location.href="simplenote://new?content="+encodeURIComponent(note)+"&tag=webclip";p.hidden=true;}};request.open("GET",url,true);request.send();})();