Wednesday, 8 June 2011

How to Find a Facebook User ID

The Facebook Like button is ever more prevalent, with countless uses all over the web, but many site administrators will want to control the way that 'Likes' for their sites appear on users' news feeds, in particular by specifying their own logo or graphic to accompany the story.

In order to do this, Facebook requires that the 'Liked' page participate in the Open Graph, so that an Open Graph image can be specified.

This is a relatively straight-forward affair, involving the addition of a collection of <meta> tags defining og: properties (which, annoyingly don't validate as compliant HTML, but that's another story), but there is one requirement that appears to have been added after the initial roll-out, as pages that omitted it worked before and then suddenly stopped working.

That requirement is for the specification of fb:app_id or fb:admins in order to provide administrative authority for your pages within the Open Graph.

While fb:app_id (Application ID) is easy to find, fb:admins requires the user ID of one or more administering users - and this ID can be rather difficult to find when the users have deployed vanity URLs, which mask their normal profile page URL, which includes their user ID.

There are all sorts of crazy ways documented on the Internet to find the ID of a user, but thankfully Facebook provide a proper way that doesn't involve hiring a private detective.

All one needs to do is request the information for the user in question directly from the Open Graph, like this:

I've documented this in more detail in the XenForo User Manual, and even provided a form to make the process as easy as possible:

How to Find the ID of a Facebook User

Tuesday, 7 June 2011

Barefoot Badminton

For the most part I play badminton with bare feet. This may draw gasps of horror from some players, who question whether I end up with blisters and burns and twisted ankles, but I have never had any of those things. In fact, the last time I put my badminton shoes on, I quickly ended up with a sprained ankle due to the higher centre of gravity and less-stable platform provided by padded footwear.

At the risk of stating the obvious, playing badminton barefoot is not the same as playing with shoes.

It's not possible to simply plant a foot and rely on the mechanical grip of the sole to begin a change of direction. It's also imperative to keep legs flexed and weight forward so that contact with the floor is primarily through the forefoot, as landing on, or striking the floor with heels is not to be advised.

A light step and swift footwork are required to move effectively around the court. While sliding and heavy landings are precluded, jumping and agility at the net are greatly improved. I am completely free of ankle or knee pain after badminton, which can be a common complaint from those who land heavily in shoes.

Last night, I decided to play a few games in my Vibram FiveFingers, about which I wrote recently.

I have a few observations:

Firstly, the degree of grip with the floor is definitely improved, but I'm not entirely sure that this is a good thing, as it encourages actions that place a great strain on the lower legs and knees, as the momentum of the body is arrested in an artificially rapid manner by the contact with the floor.

Secondly, even though there is almost no padding in the FiveFingers sole, the lack of sensation from the floor into the plantar surface seems to convince the mind that there is a degree of padding available, and as a result I found myself landing much more heavily in the Vibrams than I would normally expect when barefoot. While I think I was still relatively light-footed, I could see a potential situation where this false sense of security could result in injury to the foot, perhaps even stress fracture in extreme cases.

The sensation of playing badminton in Vibram FiveFingers is comparable to playing with bare feet, but it's not a switch I would make permanently. For the time being, I plan to limit their use to a few games per session.

To anyone thinking of shedding their shoes to play badminton, I would certainly commend you to do so and experience the benefits - it's a great way to teach yourself to stay light and agile on court. It may not be suitable for very high-speed competitive play, but for club nights it has served me very well for several years now. It may be a bit of a system shock the first time you play barefoot, so take it easy and stay on your toes, but with a few games' practice you'll be in the swing of things.

Yes, the soles of you feet will end up black by the end of a session, but that's why we invented soap, right?

Friday, 3 June 2011

Google PlusOne HTML 5 API Broken

Google's new +1 Button normally mandates a somewhat cumbersome <g:plusone> tag, but this tag is not HTML compliant without a custom DTD, and worse, is unselectable by jQuery using normal selectors.

Thankfully, they also provide an HTML 5 <div class="g-plusone"> option.

While the <g:plusone> tag is configured with 'size' and 'url' attributes, in order to be HTML 5 compliant, the <div> version passes parameters using HTML 5's 'data-' attributes, such as 'data-size' and 'data-url'.

Or at least, that's what the documentation says.

In actual fact, the HTML 5 version ignores data- attributes, and responds only to normal, non-data attributes.

I have put together a test case to illustrate the problem:
Test case demonstrating the broken +1 HTML 5 implementation.

Hopefully Google will address this quickly.

Update, June 14 2011
The test case now renders correctly, indicating that Google has fixed the problem. Hooray!