like button Archives - Stay N Alive

How is Quora Able to Auto-Like Posts on Facebook?

screen-shot-2011-01-10-at-3-03-27-am-300x137-8191874I’ve been contemplating a way to get Facebook like buttons to work with a brand’s own look and feel, so when you like it on a 3rd party site, it automatically likes the same Page (via Open Graph Protocol) on Facebook.  This would be a User Experience Designer’s dream come true, especially those that I work with in my day job trying to design stuff that works with Facebook.  Today I remembered that there is a site that is doing just that: Quora.  The problem is there is no API method that currently allows Facebook developers to send “likes” to URLs or Pages on Facebook.

Right now on Quora when you click “up” on any answer on Quora, if you’ve associated a Facebook account with your Quora account you have the option, in your settings, to also “like” the page for the answer on Facebook.  Doing so shows a post in the news feed that says something like “so and so likes such and such an answer on Quora”, linking back to the answer on Quora.  The likes, via Facebook’s Graph API also go up with that click.  This auto-posting is probably also helping to contribute to Quora’s massive growth in such a short period of time.

I thought I’d try to hack it to see if I could figure out what Quora is doing.  I’m pretty sure they’re getting special access by Facebook to do it.  Right now when I send a “POST” method call to https://graph.facebook.com/likes, with http://pathtoanyurl.com in a “url” parameter (and a working, offline_mode, access token), I get a message back from Facebook that says, “App must be on whitelist”.

I’m assuming Quora is on a special whitelist for Facebook to be able to auto-like posts via Facebook’s API, something most developers on Facebook Platform aren’t allowed to do.  This would make a lot of sense, considering Quora’s own founders were also some of the original founders of Facebook and most likely have very close ties with the service and its employees.

screen-shot-2011-01-10-at-3-01-20-am1-8832406

Now I just want to know, how can I get this whitelist access?

If you have a better answer, answer here, on Quora of course!

Counting "Real" Likes on any URL – Evaluating the Salt Lake City vs. Fresno Campaign

logo-6543494In the last week I saw one of the most amazing campaigns of unity amongst 2 communities, Salt Lake City, Utah, where I live and where I asked for your help, and Fresno, California. Both cities were entered into Walmart’s “Fighting Hunger Together” campaign in a race to get the most “likes”. The prize? 1 million dollars donated to the Food Bank of the community with the most “likes”. $100,000 would be donated to each of the next 5 communities with the most “likes”.  Thanks to yours, and others’ help, both Salt Lake City and Fresno seemed to take off the most.  Both cities launched media blitzes, a telethon of sorts, that telethon lasting more than 3 days, begging viewers, listeners, and readers to like their communities in hopes to rally the individual community to earn their cool $1 million towards the hungry and homeless.  I don’t know of a TV or Radio station in Utah that wasn’t talking about this every 15 minutes or so.  Campaigns were even set up to help people set up their Facebook accounts, and then close them when the campaign was done!  It was a Christmas Miracle to see both communities fighting so hard to win, Fresno outranking Salt Lake City by around 200,000 votes at one point, but Salt Lake City sprinting to the finish, obliterating the competition.  In the end, Salt Lake City rallied, soliciting over 5 million votes, completely overshadowing Fresno at second place by over 1 million votes.  The third place city didn’t even eclipse 500,000 likes.

The real story though is how each city grew their “likes”.  Walmart was counting “likes” by the total on the like button embedded in the website.  You can see that still on my previous article soliciting your help (click the link), something any website can embed using Facebook Social Plugins (I also included the HTML so others could embed it on their sites).  The “like buttons” tally votes by the number of shares of the URL, followed by the total number of comments on each share.  It’s hardly a count of the total number of people that actually liked the post, and some would argue, not a fair tally.  Fresno was even calling foul, perhaps out of jealousy, that Salt Lake City was using tactics such as creating Fake profiles, sharing the page thousands of times, and encouraging others to click through and like each share on the Fake profile.  Of course, Fresno was doing the same.  It was rather ironic that in the end Salt Lake’s total “likes” exceeded the total population of Utah as a whole!  I’m sure it could be possible, especially considering bloggers like myself were sharing outside of Utah to solicite votes, but hardly believable.  Of course, Fresno was in the same boat.

There is a way however, for anybody to get the “real” tally of votes for a URL with Facebook Graph API.  It turns out with Graph API you can pass a URL to it to get the ID and additional information about that URL.  So, without further adieu, here are the actual “like” counts for both Salt Lake City and Fresno:

Salt Lake City (click the link to see the Graph API response): 136,820 total likes (unique people)

Fresno (click the link to see the Graph API response): 89,578 total likes (unique people)

So, it would appear that, no matter how you “like” it, Salt Lake City still won the competition, fair and square.  In one of the most amazing feats of unity around such an amazing cause, I’m proud of my city because of this.  Salt Lake City gets social media.  We get how to rally, and we get how to work with each other to help out the homeless.  As a result, Utah’s Food Bank believes it can turn that 1 million dollars into 7 million dollars with the programs it has in place.  The 4th place city, Ogden, Utah will also get $100,000 – Utah Food Bank has pledged that the $100,000 from Ogden, along with the $1 million will get shared across the entire state of Utah, multiplied by 7 in helping the poor and needy.  Homeless from all over the nation actually flock to Utah because of our Homeless programs.  THANK YOU for your help.  I know many of you voted, and I’m sincerely appreciative for this.

If you ever need to tally the “real” likes for an Open Graph URL that uses the “like box” Social Plugin, use the technique I mentioned above – simply pass https://graph.facebook.com/http://pathtoyoursite.com to your browser and you’ll get the likes for your site.

Again, THANK YOU!

If you want tips like just like this one, be sure to pre-order my next book, “Facebook Application Development for Dummies”.  Any “dummy” can understand cool stuff like this!

Facebook’s Like Button for the Whole Internet – Here’s How it Works

Techcrunch today talked about a new “Like Button for the Whole Internet” which Facebook looks to be launching some time soon, and has been tested amongst several developers as they’ve been told.  What they didn’t mention is that you can access the code for this right now in the code to the latest open source Javascript SDK.  While it does not currently work in its current form, it is open for the entire public to see, and has been there for the last few months (along with a few other hints I’ll let you find).

Assuming the source of the new SDK (currently in alpha) remains the same, the XFBML button can be placed on any website on the internet, and it increments the number of likes when a user clicks on it.  By default it increments the likes for the current page, but there appears to also be the ability to specify a “permalink” attribute, along with a URL to another page.  It’s unclear if that will be changeable in the XFBML tag or not.  Also, a required “node_type” attribute that defaults to “page” can be set.  Lastly, an optional “page_url” can be set.  The XFBML tag loads content from /widgets/like.php (attributes of the XFBML tag get passed as attributes in the URL).  That URL appears to be disabled at the moment.

So it looks like the XFBML tag will look something like the following, and it will be part of Facebook’s widgets architecture:

Also of interest, Facebook has an entire tag library devoted to the new tag, like.js.  You can probably gain a little more info from that.  I can’t wait for them to turn on like.php so we can play with this.

My book, FBML Essentials, may just get a lot more interesting as Facebook prepares for their “OpenGraph API”, enabling any website to become its own Facebook Fan Page across the internet.  This is one of many tags I’ve seen that are very interesting – see if you can look through the code and find anything else that looks interesting like this.  I love being a developer. 🙂