![]() |
| Ted making a play from shortstop, May 2013. |

I confess that I'm really not a power user when it comes to Facebook. Often, I want to do something that seems easy enough but turns out to be deceptively complicated. Case in point: when posting a photo, I really wanted to add a user hyperlink to the photo's caption. 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 the link; the ID will appear in the URL of the user's Facebook home page. The user ID enabled savvy Facebookers to do all sorts of things (some clever, 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 lo and behold, there is a fairly simple, straightforward way to find an ID using the user's Facebook username. 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 link 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 for any user profile on a 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 small piece of code will let you create a hyperlink to a user profile (who is not on your friends list). The code for adding the hyperlink into a wall post, or image caption, is:
@[PROFILE_ID:0]
So, to tag 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:
Type 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).
The photo posted. The tag worked. That kid's name linked properly in the caption, and his parents found the picture and left a comment thanking me for it.
The whole thing took about twenty minutes more than it should have. That's Facebook's fault, not the Open Graph API's.
Here's the thing, though. The reason I needed to figure this out — that's worth naming. I was trying to make sure the right people got credit in a story that belonged to all of them. A game photo without the names is a game photo. A game photo with the names is a record. And my kids' years growing up — the games, the plays, the people who were part of those moments — deserved to be recorded accurately.
That's what this blog is, when you get down to it. The workarounds are different from post to post. The point is the same.
A few thoughts before you take the plunge:
First, the steps above work as of October 2012. Facebook changes its platform regularly and without much warning, so there are no guarantees this method will survive the next update. The December note above is already a sign of that.
Second, this only matters if you're trying to tag someone not already in your Friends list. If they're a friend, Facebook makes it easy. If they're not, you're in Open Graph territory.
Third, and this is the part that took me the longest to learn, sometimes the right answer to a broken tool isn't a workaround. It's a workaround plus a note explaining it, so the next person doesn't spend twenty minutes in the same dead end.
You're welcome.




No comments:
Post a Comment