MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

13 September 2006

MeCha suggestion box? I had a notion, and it's something that might really improve the quality of life here.[More:]

Is there a way to build a widget that will you let you seach for a specific URL that has been linked to the site so that if you see a neat image or website, you can check to see if it has been linked before?

Because I saw an OMG! BUNNY! on Neil Gaiman's journal, but I'm not sure if the bunny picture or the company has been linked here before.
@url = '%' || @url || "%"

select 'That url has '
|| case when
( select count(*) from posts
where title like @url
or url like @url
or body like @url ) > 0 then '' else 'not ' end
|| 'been posted.'
posted by orthogonality 13 September | 10:33
What the hell does that mean, ortho?
posted by essexjan 13 September | 11:17
Because I saw an OMG! BUNNY! on Neil Gaiman's journal, but I'm not sure if the bunny picture or the company has been linked here before.

If it was this one, then no, it definitely hasn't.
posted by essexjan 13 September | 11:26
It's SQL. The "||" are catenation operators, not "or" operators.

If seanyboy ran that against the database, it would tell you if some arbitrary url ("@url") had or had not previously been posted.

(It makes some assumptions about the layout of the back-end database.)

Put up a page that submitted a url and ran that against the database, and you'd have what TrishaLynn wants.

If the url exists, the database sends back "That url has been posted.", otherwise it sends back "That url has not been posted."
posted by orthogonality 13 September | 11:30
So, ortho... You know and understand the beast that is SQL hey. Fancy helping me with a little bit of troubleshooting?

(* specifically, optimising a couple of SQL statements which could use the indexes handily provided to them, but instead insist on search through the whole database *)
posted by seanyboy 13 September | 12:04
Trisha-post it! I don't think anyone here is against seeing the same OMG BUNNY!!! over and over. Well, by "anyone here" I specifically me...
posted by muddgirl 13 September | 13:02
seany, sure, no prob.

Could you please send me the following:
Your database and version;
the sql statements in question and the showplan or explain for each;
the dl of the tables in teh statements' from clauses, including any indices?

Please send to my gmail address 'theorthogonal'.
posted by orthogonality 13 September | 16:21
s/dl/ddl
posted by orthogonality 13 September | 16:21
James Blunt Meets His Beautiful Cubicle || Why is Metafilter down every morning?

HOME  ||   REGISTER  ||   LOGIN