Tag Archives: Facebook

Blogs are the Next Big Social Network

Why do people use Facebook? What does it offer, besides an enormous user base, that makes it such an attractive internet destination? At it’s core, it’s just a tool for sharing short posts. Twitter and Tumblr also accomplish the same thing, for the most part.

Blogs can do everything Facebook or Twitter can do, though they lack the centralization. You have to manually go out and visit them to see what’s new, or use RSS, which isn’t exactly intuitive to less technical users. Blogs are, in their barest form, a reverse-chronological listing of postings. Those posts can be of any length, and contain any type of information. Plain text, images, audio, video, etc.. Some platforms, like WordPress and Tumblr, even offer features to differentiate between types of posts. Photo galleries? You can even do that if you set it up right. Profiles? That’s what About pages are for.

The only thing that’s missing is a standardized federation API that broadcasts information about a blog, linking them together so you can have user-friendly news feeds like Facebook or Twitter. The API would include basic profile information, such as your name and the URL of your chosen avatar, the URL of the blog, and anything else that a social networking would need to query.

Continue reading →

Adding and Tracking Social Buttons

It seems like every website has social media buttons on them now. The ones leading the pack of late seem to be Twitter, Google +1 and the Facebook Like widget. This introduces one problem: loading times. Your pages are calling JavaScript files hosted on remote servers, bogging them down a bit.

Joost de Valk has put together a good tutorial on how to fix that issue. It features code snippets that will load the widget JavaScript asynchronously, keeping the buttons from holding up the page loading. Also, it even adds Google Analytics and Clicky tracking so you can tell if people are actually using your buttons.

When Google released +1, I quickly identified how to track interaction with that button. The obvious “follow up” was questions from people on how to track interaction with other buttons. Not for each of these social buttons tracking of interaction is actually possible. It depends on how the button was designed whether this will work or not. I got it working for Twitter and Facebook, so I’ll share the code for tracking interaction with their respective social buttons below.

Social Buttons: Adding them to your site & Tracking them [Yoast]

Get Twitter and Facebook Link Statistics with JSON and jQuery

Both Twitter and Facebook have little JavaScript widgets that allow you to share a page using the respective service, displaying a running total of users who have done so. While that’s fine for most purposes, what if you just need the count, for some atypical application?

It’s not well-documented, but the two social media sites have JSON APIs for that purpose.

With a little bit of jQuery magic, you can collect the values on page load and update the DOM with the number. Here’s something I threw together for a project I was working on:

(function() {

var url = 'http://xkcd.com/792/';

jQuery.getJSON("http://urls.api.twitter.com/1/urls/count.json?url="+url+"&callback=?", function(data) {
jQuery('#socialstuff span.twcount').html(data.count);

jQuery.getJSON("https://graph.facebook.com/"+url+"&callback=?", function(data) {
jQuery('#socialstuff span.fbcount').html(data.shares);


As long as you remember to include jQuery, and have the right HTML elements for the JavaScript to populate, it’s pretty much plug-and-play.

You can see it in action here.

Facebook Privacy Scanning Bookmarklet

Unless you’ve been living under an internet-devoid rock, you have probably noticed the recent uproar over Facebook “privacy.” The social media giant made some changes, with various confusing privacy implications that have everyone panicking. By default applications can access some personal details (that you might not want them to be able to access) simply because one of your friends has used the application. Then there’s the relatively harmless “Instant Personalization” feature, which lets a select group of sites pull profile data to customize your experience…but only if you agree to it on a site-by-site basis. (A lot of people have freaked-out over the new JavaScript widgets as well, even though they’re built entirely on the client side rather than the server, meaning Facebook is the only party seeing the contents.)

The good news is that there’s now an open-source bookmarklet that can scan your profile and recommend tweaks to lock-down your profile a bit, since Facebook’s privacy settings are so byzantine that few have the patience to wade through them. ReclaimPrivacy.org’s script runs a series of tests and gives you a convenient button to fix the problem if you so choose.

Did Facebook Just Patent Twitter?

Facebook was just granted a patent for something that should prove to be controversial. Patent #7,669,123, which was filed for in 2006, is for “A method for displaying a news feed in a social network environment…” The abstract reads:

A method for displaying a news feed in a social network environment is described. The method includes generating news items regarding activities associated with a user of a social network environment and attaching an informational link associated with at least one of the activities, to at least one of the news items, as well as limiting access to the news items to a predetermined set of viewers and assigning an order to the news items. The method further may further include displaying the news items in the assigned order to at least one viewing user of the predetermined set of viewers and dynamically limiting the number of news items displayed.

It sounds to me like they just patented a fairly obvious mechanism that has been long used by sites like Twitter, Digg, Reddit, RSS readers, blogs, etc..

Am I the only one who isn’t okay with this sort of patent-trolling behavior? Why does the USPTO keep letting these kinds of application through? It’s bad enough that Amazon is still fighting to have their one-click buying patent approved, and now we have another stupid patent that is just too obvious. Facebook is by no means the first website to have a “news feed,” and the idea is hardly patent-worthy.

Facebook Just Patented The Feed – What Does That Mean For Everyone That Uses Them? [TheNextWeb]

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,” aims to solve. HipHop converts PHP scripts to C++ code and then uses g++ to compile it. This brings a CPU usage decrease of up to 50%, according to the announcement.

One night at a Hackathon a few years ago (see Prime Time Hack), I started my first piece of code transforming PHP into C++. The languages are fairly similar syntactically and C++ drastically outperforms PHP when it comes to both CPU and memory usage. Even PHP itself is written in C. We knew that it was impossible to successfully rewrite an entire codebase of this size by hand, but wondered what would happen if we built a system to do it programmatically.

Interesting, for sure. Imagine using it with WordPress for a high-traffic blog…

HipHop for PHP: Move Fast [Facebook Developer Blog]