How to hack a MeFi URL using only post numbers? January 31, 2008 8:06 AM   Subscribe

How do I hack a MeFi URL if I only have the post number and not the title? For example, metafilter.com/68665/ does not work, but metafilter.com/68665/Back-to-the-Future does.

The reason I'd like to know is that I'm playing around with some of the data in cortex's infodump, and I'd like to be able to generate URLs from the post ID numbers. I don't understand how to do this without knowing the title of the post/question.
posted by desjardins to Bugs at 8:06 AM (14 comments total) 4 users marked this as a favorite

The format: http://www.metafilter.com/mefi/12345 will redirect automatically to the nicely formatted URL with a title (as a 301 redirect).

I'd suggest using that format in any web interface you build to the data.
posted by mathowie (staff) at 8:09 AM on January 31, 2008


Actually, misunderstanding in play here:

http://www.metafilter.com/68665/ will indeed work. It's the no-trailing-slash version, http://www.metafilter.com/68665, that fails.

Common goof.

And, as Matt says, the old url version of http://www.metafilter.com/mefi/68665 will work, too. And a trailing slash on that version will break.
posted by cortex (staff) at 8:13 AM on January 31, 2008


Also, for those who haven't been checking projects, null terminated has built some SQL awesomeness for the MeDump.
posted by middleclasstool at 8:22 AM on January 31, 2008 [1 favorite]


Just to be clear on what cortex says, two of those variants will work, but the one that redirects to the ultimate URL people are used to using is the /mefi/ID-number one (with no trailing slash). Please use that one wherever possible.
posted by mathowie (staff) at 8:40 AM on January 31, 2008 [2 favorites]


I feel compelled to bring up this suggestion again. It's really the most user-friendly thing to do.
posted by ardgedee at 9:10 AM on January 31, 2008


You can do http://www.metafilter.com/68665/anything if you want to..

I recall some consternation when matt changed the URL scheme that this could be used for nefarious purposes (i.e http://www.metafilter.com/68665/i am a turd for posting this)
posted by davey_darling at 9:32 AM on January 31, 2008


null terminated is my hero. oh, and that cortex dude too. That mathowie guy is alright.

I'm not building any super-secret web interface. Just geeking around on my own.
posted by desjardins at 9:36 AM on January 31, 2008


The reason I suggest using *.metafilter.com/mefi/123 is because that always redirects to the URL used throughout, and it's the one "true" address for a thread that Google already knows about. All the other ones with a trailing slash or filler text will just mess with google and create multiple versions of the same thing, which kind of sucks in the long run.
posted by mathowie (staff) at 10:27 AM on January 31, 2008


Matt: http://ask.metafilter.com/mefi/82454/ doesn't work but http://ask.metafilter.com/82454/ does.
posted by desjardins at 1:48 PM on January 31, 2008


desjardins, yes as I said, of the four URLs that cortex presented, 2 of them work, two of them do not and it's not trivial to fix (there are a couple dozen rules piled on top of each other in Apache to make the ones that work, work).

It would be best if you could only link to *.metafilter.com/mefi/ID-number without a trailing slash, so there aren't multiple URLs floating around in Google. It is the only URL that will redirect instantly to the nice one with the full title and ID in it that you can't guess from the metadata we provided.
posted by mathowie (staff) at 1:54 PM on January 31, 2008


Yeah, let me sum it up in a happy chart:

http://ask.metafilter.com/mefi/82454 <-- PREFERRED
http://ask.metafilter.com/mefi/82454/ <-- doesn't work
http://ask.metafilter.com/82454/ <-- works, not preferred
http://ask.metafilter.com/82454 <-- doesn't work

As far as preferences go, it doesn't matter so much if you're generating links that google's not going to end up indexing, but if you're generating permanent links in some context it'll keep the google situation cleaner if you use the PREFERRED method.
posted by cortex (staff) at 1:59 PM on January 31, 2008 [3 favorites]


Sorry to make you repeat yourselves. I'm having a lousy day.
posted by desjardins at 3:40 PM on January 31, 2008


No, it's cool. Some of this stuff should probably get documented anyway, so discussing it and working out the details isn't really a bad thing.
posted by cortex (staff) at 4:07 PM on January 31, 2008


I'm so glad to find out how this works now.
once those tags were added to the URL, I thought my days of hunting the deleted posts were a thing of the past. there's nothing like going over to a friends house and telling them to look at the blue only to find the post has been nuked.
huzzah!
posted by Busithoth at 8:07 AM on February 2, 2008


« Older Look out, Fester Bestertester   |   Privacy or Criminal Activities? Newer »

You are not logged in, either login or create an account to post comments