Skip to content

Instantly share code, notes, and snippets.

@mobilemind
Created April 11, 2016 06:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mobilemind/2de881ab304f534fa2ecdc7619ddffaa to your computer and use it in GitHub Desktop.
Save mobilemind/2de881ab304f534fa2ecdc7619ddffaa to your computer and use it in GitHub Desktop.
Remember the Milk bookmarklet to add current selected text & web page as a task due tomorrow using RTM Mobile web app
// javascript:%28function%28%29%7Bvar%20n%2Cw%3Bif%28window.getSelection%29n%3Dwindow.getSelection%28%29%3Belse%20if%28document.getSelection%29n%3Ddocument.getSelection%28%29%3Belse%20if%28document.selection%29n%3Ddocument.selection.createRange%28%29.text%3Bw%3Dwindow.open%28%27https%3A%2F%2Fm.rememberthemilk.com%2Fadd%3Fname%3D%27%2BencodeURIComponent%28null%3D%3D%3Dn%7C%7Cundefined%3D%3D%3Dn%7C%7C%27%27%3D%3Dn%3Fdocument.title%3An%29%2B%27%26due%3Dtomorrow%26url%3D%27%2BencodeURIComponent%28location.href%29%2C%27addwindow%27%2C%27status%3Dno%2Ctoolbar%3Dno%2Cwidth%3D475%2Cheight%3D260%2Cresizable%3Dyes%27%29%3BsetTimeout%28function%28%29%7Bw.focus%28%29%7D%2C475%29%7D%29%28%29%3B
// (function(){var n,w;if(window.getSelection)n=window.getSelection();else if(document.getSelection)n=document.getSelection();else if(document.selection)n=document.selection.createRange().text;w=window.open('https://m.rememberthemilk.com/add?name='+encodeURIComponent(null===n||undefined===n||''==n?document.title:n)+'&due=tomorrow&url='+encodeURIComponent(location.href),'addwindow','status=no,toolbar=no,width=475,height=260,resizable=yes');setTimeout(function(){w.focus()},475)})();
(function() {
var n, w;
if (window.getSelection) n = window.getSelection();
else if (document.getSelection) n = document.getSelection();
else if (document.selection) n = document.selection.createRange().text;
w = window.open('https://m.rememberthemilk.com/add?name=' + encodeURIComponent(null === n || undefined === n || '' == n ? document.title : n) + '&due=tomorrow&url=' + encodeURIComponent(location.href),'addwindow','status=no,toolbar=no,width=475,height=260,resizable=yes');
setTimeout(function(){w.focus()},475)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment