Category Archives: Coding

A Standard to Specify a Canonical Short Link

There has been a small push to create a standard way for a web page to specify a preferred short link for use in places like Twitter. Something like the rel="canonical" trick that tells search engines which page on your domain is the one that should be indexed. Basically, a meta tag to put in the page header, which could then be read by Twitter applications. The end goal is to help reduce the issue of “link splintering,” where everyone ends up linking to the same page with a different URL. (For instance, I could shorten a link to this page with Is.gd, then three others could create their own different Bit.ly links…)

One proposal is rev=”canonical”, but I really don’t I don’t like that option. This comment sums it up pretty well. Rev is too easily confused with rel, and is deprecated in HTML5 to boot. The “canonical” terminology also isn’t fitting, since it implies that the short URL is the preferred URL for the page (i.e. “the short link is preferred over the full one”) rather than an alternate link.

I found it interesting to learn that WordPress 3.0 is going to start automatically including something along the lines of this on permalink pages:

<link rel='shortlink' href='http://fantasyfolder.com?p=32' />

There will be hooks to override it with your own URL (so a plugin could place a single Bit.ly or YOURLS link there on publication), but the URL is irrelevant for the purpose of this discussion. The rel='shortlink' part is what interests me. I think it’s the perfect term to use for this scenario.

I think, whether you use WordPress or not, rel="shortlink" is what you should go with. (If you’re worried about controlling short links, at least.)

Why Do Some PHP Variables Have an Ampersand Before Them?

If you’ve worked with PHP a bit, you may have seen someone put an ampersand (“&”) in front of a variable, like this: In this example, we’re using a WordPress hook, and passing an array with a class and method combination, instead of just…

iPhone Application Development For Dummies

Have you ever wanted to learn how to write your own iPhone applications? It’s certainly more difficult than web development, but the device is a good platform to learn client-side programming with. Mobile applications that tie into web services are becoming increasingly common, so…

Working with RESTful Services in CodeIgniter

The modern web is full of APIs. Many interesting sites have been created by mashing up data sources from multiple “Web 2.0″ sites. Net.Tuts+ has a new tutorial on Working with RESTful Services in CodeIgniter. I found it to be quite an interesting read,…

Facebook Announces HipHop for PHP

PHP is my favorite server-side programming language, but it has one major Achilles’ heel: speed. A language that is interpreted by the server at load time can’t hope to compete with a compiled language for speed. That’s what Facebook’s new project, “HipHop for PHP,”…

An API for the Web: Learning YQL

I just read one of the most interesting articles Net.Tuts+ has published in the last few months: An API for the Web: Learning YQL. Web apps and web services multiply like rabbits. They’re all fun to play with (like rabbits) and fun to integrate…

jQuery 1.4 Released

Version 1.4 of jQuery has been released, and Net.Tuts+ has published a nice guide to some of the more interesting features that are now available. I’m particularly interested in the first item, which sounds intriguing. Pre 1.4, jQuery supported adding attributes to an element…

Learning oEmbed

WoorkUp has an interesting post on oEmbed, and how you can use jQuery to take something like a YouTube or Flickr URL and automatically load the video or image on the page. Facebook uses this technique to fetch thumbnails and descriptions when you post…

Automatically Scroll Web Pages With jQuery

You’re probably already aware that you can create “anchors” by giving an empty <a> element a name, and then pointing another link to #thename. But what if you want something a little more…elegant? The ScrollTo jQuery plugin allows you to make the page scroll…

Rolling Your Own PHP Framework

Fuel Your Coding has a three-part series worth checking out. It covers how to build your own lightweight PHP framework for your projects. There are quite a few php frameworks out there. Some huge, some small; Some useful, some not. I often hear developers,…