Saturday, October 20, 2012

Tag, You are It!

I confess that I'm really not a power user when it comes to Facebook. Often, I want to do something that seems like it will be easy enough, but ends up turning out to be deceptively complicated.  Case in point, when posting a photo I really wanted to add a user hyperlink into the caption of the photo. The new "timeline" iteration of Facebook seems to make this an easy task, but try as I might, it is just about impossible to create the link when the person you want to link to is not one of your friends (but pretty straightforward if they are...).

After much trial and error, I was able to work out a process to add links into my photo captions, status updates, and other Facebook content, but it takes some planning and a couple of steps to accomplish this task -- for your Facebooking pleasure here is how I do this:

Step one, find the user's Facebook ID.  Back in the early days of Facebook all users had ID numbers that were fairly easy to find. Simply look them up and click on the link and the ID would appear in the URL of the users Facebook home page.  The user ID allowed savvy Facebookers to do all sorts of things (some clever and some nefarious).  But Facebook introduced custom (or vanity) URLs not too long ago, and that made it much more challenging for the neophyte to find the actual user ID.
 
But low and behold, there is a fairly simple and straight forward way to find an ID just by utilizing the user's Facebook user name. Because every object within the Open Graph has a unique URL it is easy enough to have information returned about that object (as long as you know the key - in this case the user's vanity profile link. Users pages are no exception.

For a facebook profile with a vanity URL, you will see something like this:

http://www.facebook.com/nicholas.myra.7

So for this example all you really need is the value of the users Facebook username which in my example is nicholas.myra.7

Launch this ink in your browser window:

http://graph.facebook.com/nicholas.myra.7

Now, you should see something that looks like this:


The user ID is specified in the id property. Simply copy this value (without the quotation marks). The same goes any user profile of Facebook fan page. You only need to add the username after http://graph.facebook.com/ to get the ID.

Now that you have the ID, a little piece of code will allow you to create the hyperlink to a user profile (who is not in your friends list).  The code for adding the hyperlink into a wall post, or image caption, is:

@[PROFILE_ID:0]

So, to post a tag to Nicholas Myra, you would simply type @[100000034458111:0] and voilĂ , the user's name appears in your post with a hyperlink to their Facebook profile (friend or not).  Here are before and after pictures:

Typing in the text string (with ID) and click the "done editing" button, and you get:

UPDATE (Dec. 2012): After much experimentation, I have found that this trick will only add the hyperlink if the permissions on the user account (that you are linking to) permit tagging, otherwise FB just inserts the user's name (sans the link).

QED