Thread about deleted-post bookmarklet was closed prematurely. January 15, 2006 1:07 PM Subscribe
I hate to push something more important off the front page for this, but I think this thread about the deleted-post bookmarklet was closed prematurely. [MI]
So why aren'y you mailing the authior, milov, directly?
posted by orthogonality at 1:11 PM on January 15, 2006
posted by orthogonality at 1:11 PM on January 15, 2006
I concur.
posted by puke & cry at 1:11 PM on January 15, 2006
posted by puke & cry at 1:11 PM on January 15, 2006
Because the author doesn't read e-mail from nobody.
posted by Eideteker at 1:30 PM on January 15, 2006
posted by Eideteker at 1:30 PM on January 15, 2006
Or because the author doesn't read e-mail from just nobody.
posted by Eideteker at 1:31 PM on January 15, 2006
posted by Eideteker at 1:31 PM on January 15, 2006
Just replace "www" with "ask" in the generate link.
javascript:void(A=document.getElementsByTagName('a'), N=[],M=[],f='); for(i=0;i<A.length;i++){ void(h=A[i].href,p=h.indexOf('/mefi/')); if(p!=-1 && h.indexOf('#')==-1 && A[i].parentNode.tagName.toLowerCase()=='span'){ void(k=h.substring(p+6,h.length),N[N.length]=k,M[k]=1)}} for (i=N[0]; i>N[N.length-1]; i--) { if (!M[i]) f += '<a target=_blank href=http://ask.metafilter.com/mefi/' +i+'>'+i+'</a>\n'; } void((W=window.open()).document.write('Deleted threads: ' + f));void(W.document.close());
posted by orthogonality at 1:40 PM on January 15, 2006
javascript:void(A=document.getElementsByTagName('a'), N=[],M=[],f='); for(i=0;i<A.length;i++){ void(h=A[i].href,p=h.indexOf('/mefi/')); if(p!=-1 && h.indexOf('#')==-1 && A[i].parentNode.tagName.toLowerCase()=='span'){ void(k=h.substring(p+6,h.length),N[N.length]=k,M[k]=1)}} for (i=N[0]; i>N[N.length-1]; i--) { if (!M[i]) f += '<a target=_blank href=http://ask.metafilter.com/mefi/' +i+'>'+i+'</a>\n'; } void((W=window.open()).document.write('Deleted threads: ' + f));void(W.document.close());
posted by orthogonality at 1:40 PM on January 15, 2006
The author however does check his HTTP_REFERER strings, and concurs with orthogonality.
posted by milov at 2:18 PM on January 15, 2006
posted by milov at 2:18 PM on January 15, 2006
Busted.
posted by orthogonality at 2:22 PM on January 15, 2006
posted by orthogonality at 2:22 PM on January 15, 2006
Inspired by ortho's sleuthing, I've just updated my bookmarklet link to use the location.host property instead of a fixed domain name. Just redrag it to your toolbar and it should work for both the blue and the green (there don't seem to be any recently deleted AskMe's at the moment, but I tested it on the January 2006 archive).
posted by milov at 2:31 PM on January 15, 2006
posted by milov at 2:31 PM on January 15, 2006
milov: use an Xpath and make your life easier.
posted by orthogonality at 2:34 PM on January 15, 2006
posted by orthogonality at 2:34 PM on January 15, 2006
Oh, and apologies for butting in on your code.
posted by orthogonality at 2:35 PM on January 15, 2006
posted by orthogonality at 2:35 PM on January 15, 2006
Thanks for reopening. I posted the original thread, and have an email in to Matt explaining why his suggestion wouldn't work for me.
Also, orthogonality: I tried that. It doesn't work completely - while it DOES include deleted threads, it also includes a bunch of threads that are perfectly OK. As I mentioned, I'm not enough of a javascript person to figure out what went wrong.
Thanks, Milov!
posted by aberrant at 2:44 PM on January 15, 2006
Also, orthogonality: I tried that. It doesn't work completely - while it DOES include deleted threads, it also includes a bunch of threads that are perfectly OK. As I mentioned, I'm not enough of a javascript person to figure out what went wrong.
Thanks, Milov!
posted by aberrant at 2:44 PM on January 15, 2006
It's hard to tell right now, but I think this bookmarklet is going to run into the same problems I had at first with the Greasemonkey script. When anonymous threads are submitted, they take the next ID in order. But they don't get displayed in order, they're inserted next when they're finally accepted by Mathowie. So you end up getting an anonymous thread that's got an ID sometimes tens lower than the thread that's displayed above it. So you get a bunch of erroneous deleted threads.
My crappy XPath (which is arguably more complex than your method) gets around this by ignoring anonymous threads. Unfortunately, there's no way to ignore where the anonymous thread should be, if it was listed in-order.
posted by Plutor at 2:47 PM on January 15, 2006
My crappy XPath (which is arguably more complex than your method) gets around this by ignoring anonymous threads. Unfortunately, there's no way to ignore where the anonymous thread should be, if it was listed in-order.
posted by Plutor at 2:47 PM on January 15, 2006
Thanks, milov. The AskMe archives are full of either unposted anonymous questions or questions that were deleted without a reason, but there are some real gems in the mix.
posted by Gator at 4:25 PM on January 15, 2006
posted by Gator at 4:25 PM on January 15, 2006
Plutor writes "My crappy XPath "
How's your XPath tell if a link is to an anon thread? Or do you XMLHttpRequest() the link and parse it for "anonymous"?
posted by orthogonality at 4:34 PM on January 15, 2006
How's your XPath tell if a link is to an anon thread? Or do you XMLHttpRequest() the link and parse it for "anonymous"?
posted by orthogonality at 4:34 PM on January 15, 2006
(See, this turned out all right. Sorry for going about it the wrong way.)
posted by nobody at 4:59 PM on January 15, 2006
posted by nobody at 4:59 PM on January 15, 2006
You wouldn't need to request the thread itself, ortho, because "anonymous" shows up on the main ask page as the poster.
posted by kenko at 11:04 PM on January 15, 2006
posted by kenko at 11:04 PM on January 15, 2006
It checks for user 17564, aka anonymous ask metafilter.
var xpath = "//div[@class='copy']/span[@class='smallcopy'][a[contains(@href,'/user/') and not(contains(@href,'/user/17564'))]]/a[contains(text(),' comment') and starts-with(@href,'/mefi/')]";
posted by kenko at 11:06 PM on January 15, 2006
var xpath = "//div[@class='copy']/span[@class='smallcopy'][a[contains(@href,'/user/') and not(contains(@href,'/user/17564'))]]/a[contains(text(),' comment') and starts-with(@href,'/mefi/')]";
posted by kenko at 11:06 PM on January 15, 2006
I'm usually all about the low-tech hacks, but this XPath thing looks interesting/useful, thanks for the tip.
posted by milov at 4:12 AM on January 16, 2006
posted by milov at 4:12 AM on January 16, 2006
You are not logged in, either login or create an account to post comments
posted by nobody at 1:08 PM on January 15, 2006