Simon Willison’s Weblog


Thursday, 31st May 2012

What is the most efficient way to lookup an object (e.g. a user) by only a string?

Yes—an index on a varchar column is exactly how you would implement this.

[... 38 words]

Is there an API that returns metadata for a given URL?

I suggest taking a look at—it can take a huge range of URLs and turn them in to JSON metadata. Here’s what it can do with a Wikipedia page:—and here’s Google Maps URL (not as useful, but still some interesting metadata extracted)

[... 69 words]

How did get a “.sy” url?

Here’s a generally useful tip: if you’re interested in learning more about ANY top level domain, visit the Wikipedia page for it—which will be in this case (just add the domain, complete with its dot prefix, directly after ).

[... 105 words]

Which sites have the best URL design?

GitHub’s URL design is fantastic—it’s a virtually flawless mapping of Git semantics to URL space. Their basic URL structure is excellent, but they also have a bunch of neat URL hacks going on. Here are a few of my favourites:

[... 97 words]

When referring to our web site in publications (or Twitter or Facebook), when is it important to provide the full URL— and when should you provide just the

You have no control over how other publications refer to your site—if you’re lucky, they might spell it correctly and check the link works before publishing (but I wouldn’t bet on it). What you DO have control over is making sure you compensate for any mistakes they make.

[... 166 words]

2012 » May