“Share” Bookmarklet to Create a Tumblr Text Post (That Actually Works)
I do a lot of posting to Tumblr to archive notes on interesting things I’ve read online. Tumblr’s default sharing bookmarklet and browser extensions have two serious drawbacks:
1.) They either create photo or link posts, nothing else
2.) They frequently don’t work at all: the share window opens, and then the “spinner” graphic sits and pulses endlessly on an otherwise blank page, and the post creation window is never displayed
I don’t like link posts because the original page can move or disappear. I usually want to create a text post. Unfortunately these two annoyances often make that, well, annoying.
I finally got fed up tonight and hunkered down with some good ol’ Javascript. Here is a Tumblr share bookmarklet that will open a window to create a Tumblr text post with the title and a “via” link to whatever page you are viewing when you click it:
javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='https://www.tumblr.com/widgets/share/tool',l=d.location,e=encodeURIComponent,p='?url='+e(l.href)%20+'&posttype=text'+'&title='+e(d.title)%20+'&selection='+((s!=0)?e(s):'-'),u=f+p;try%7Bif(!/%5E(.*%5C.)?tumblr%5B%5E.%5D*$/.test(l.host))throw(0);tstbklt();%7Dcatch(z)%7Ba%20=function()%7Bif(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=450,height=430'))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)
If you don’t know how to create a bookmarklet, dragging this link to your Bookmarks bar should do it for you: Share As Tumblr Text Post
If you have text selected on the page when you click the bookmarklet, it will include that text as the body of the post. (Be careful, if your text is longer than the maximum allowable length of an URL, the share won’t work.)