The Elements of the Facebook Platform

As stated previously articles, the Facebook platform consists of five components: a markup language derived from HTML (Facebook Markup Language), a REST API for handling communication between Facebook and your application, a SQL-style language for interacting with Facebook data (Facebook Query Language), a scripting language (Facebook JavaScript), and a set of client libraries for different programming languages. I’ll cover these five elements in the following sections.

Facebook Markup Language

Facebook
Facebook
If you’ve ever developed in ColdFusion or JSTL (or other tag-based programming language), you’ll find working with the platform’s Facebook Markup Language (FBML) very natural. If you’re new to tag-based programming, just reckon of FBML as fancy HTML tags, because each interaction starts and ends with a tag. But, to distinguish between HTML and Facebook commands, you prefix the tags with fb: as you would if you were using multiple DTDs/schemas in XHTML. By using the FBML tag set, Facebook abstracts a lot of complex code and makes many of the routine procedures nearly effortless. For example, to add a link to your application’s help pages on your dashboard (the navigational tabs that go across the top), you simply need to add the following lines:

<fb:dashboard>
<fb:help href="help.php">Application Help</fb:help>
</fb:dashboard>

REST API Calls

Facebook API calls are grouped into eight action categories. These calls are really wrappers for more sophisticated FQL interactions with the Facebook back end but are useful bits of code that speed up the development of your application. These calls include the following:

  • facebook.auth provides basic authentication checks for Facebook users.
  • facebook.feed provides methods to post to Facebook news feeds.
  • facebook.friends provides methods to query Facebook for various checks on a user’s friends.
  • facebook.notifications provides methods to send messages to users.
  • facebook.profile allows you to set FBML in a user’s profile.
  • facebook.users provides information about your users (such as content from the user’s profile and whether they are logged in).
  • facebook.events provides ways to access Facebook events.
  • facebook.groups provides methods to access information for Facebook groups.
  • facebook.photos provides methods to interact with Facebook photos.

Facebook Query Language

The Facebook Query Language (FQL) is a SQL-style language specifically designed to allow developers to interact with Facebook information. Facebook allows you to interact with nine separate “tables” to query information directly. You have access to the following:

  • user
  • friend
  • group
  • group_member
  • event
  • event_member
  • photo
  • album
  • phototag

I’ll get into the specifics of the information you have access to in these “tables” later in next article, but suffice to say, Facebook exposes a lot of information to you for your application. And, like most SQL implementations, some additional functions allow you to take a few shortcuts when you request user information:

  • now() returns the current time.
  • strlen(string) returns the length of the string passed to the function.
  • concat(string1, string2,…, stringN) concatenates N strings together.
  • substr(string, start, length) returns a substring from a given string.
  • strpos(haystack, needle) returns the position of the character needle in the string haystack.
  • lower(string) casts the given string to lowercase.
  • upper(string) casts the given string to uppercase.

To write FQL, you follow basic SQL syntax. For example, to extract my name and picture from Facebook, you would write a simple query like so:

SELECT name, pic
FROM user
WHERE uid = 7608007

The previous snippet, when executed by the Facebook platform, will return a structure (in a format that you define in your call) with a URL to the image of the profile image for user 7608007. Calls like these are useful in giving you granular control of the information you get back from the API.

Facebook JavaScript

To minimize the threat of cross-site scripting (XSS) attacks, Facebook implemented its own JavaScript for developers who really want, or need, to use JavaScript in their applications. Facebook scrubs (removes) much of the JavaScript you can add to your application, but by using Facebook JavaScript (FBJS) you can still enrich the user’s experience. Facebook formally released FBJS 1.0 in September 2007. If you’re well versed in JavaScript, you’ll pick this up quickly (or perhaps find it maddening). The following is a quick example of how you can provide a modal dialog box to your users:

<a href="#" onclick="new Dialog().showMessage('Dialog', 'This is the help message
for this link');return fake">Show Dialog Box</a>

When processed through the Facebook platform, a user will be shown the modal dialog box represented in Figure 1-1 after clicking the Show Dialog Box hyperlink. Not terrible for a single line of code!

Client Libraries

The Facebook platform provides many tools to access information, but you are responsible
for providing your own business logic through some other language. Facebook facilitates
this through “official” client libraries for both PHP and Java that provide convenient
methods to access the Facebook application. But, not everyone in the universe uses
Java and PHP exclusively. To help the rest of the programmers who want to develop their
own Facebook application, client libraries are available for the following languages:

  • ActionScript
  • ASP.NET
  • ASP (VBScript)
  • ColdFusion
  • C++
  • C#
  • D
  • Emacs Lisp
  • Lisp
  • Perl
  • PHP (4 and 5)
  • Python
  • Ruby
  • VB .NET
  • Windows Mobile

This complement of languages should take care of just about most developers today. And although these client libraries are not “officially” supported by Facebook (meaning they won’t answer your questions about using them), they are posted by the company with at least some tacit approval of being the “officially unofficial” client libraries. By the way, I’m still waiting for them to include a library for Assembly.

Posted in Social NetworkComments (0)

Introducing the Facebook Platform

Facebook (http://www.facebook.com) has grown phenomenally over the past several years from an Ivy League social web application to the second largest social web site on the Internet. The creators of Facebook have done an impressive job focusing their social software on the college demographic. In a natural progression of the social network, Facebook recently extended its network by developing a platform for developers to make new applications to allow Facebook users to interact in new and exciting ways.

What Is Facebook?

Facebook-Buttons
Facebook-Buttons
In 2007, Facebook launched its own platform for application development. The platform consists of an HTML-based markup language called Facebook Markup Language (FBML), an application programming interface (API) for making representational state transfer (REST) calls to Facebook, a SQL-styled query language for interacting with Facebook called Facebook Query Language (FQL), a scripting language called Facebook JavaScript for enriching the user experience, and a set of client programming libraries. Generically, the tools that make up the Facebook platform are loosely called the Facebook API. By releasing this platform, Facebook built an apparatus that allows developers to make external applications to empower Facebook users to interact with one another in new and exciting ways—ways that you, as a developer, get to invent. Not only can you develop web applications, but Facebook has also opened up its platform to Internet-connected desktop applications with its Java client library. By opening this platform up to both web-based and desktop applications and offering to general users the same technology that Facebook developers use to build applications, Facebook is positioning itself to be a major player in
the future of socio-technical development.

A Brief History of Facebook

In 2003, eUniverse launched a new social portal called MySpace. This web site became wildly well loved very quickly, reaching the 20-million-user mark within a year. Just a year earlier, a bright young programmer named Mark Zuckerberg matriculated at Harvard University. The year in which MySpace launched, Zuckerberg and his friend Adam D’Angelo launched a new media player, called Synapse, that featured the Brain feature. Synapse’s Brain technology made playlists from your library by picking music that you like more than music than you don’t. Although this type of smart playlist generation is common in today’s media players, at its launch, it was an innovation.

Synapse’s launch was met with positive reviews, and several companies showed interest in purchasing the software; but, ultimately no deals were made, and the media player never took off. Unfortunately (or fortunately, depending on your perspective), one of Zuckerman’s next projects made quite a bit more controversy. He made Facemash.com, a variant of the HOTorNOT.com web site for Harvard students. To buy images for the web site, Zuckerberg harvested images of students from the many residence hall web sites at Harvard. Because Zuckerberg was running a for-profit web site and had not obtainedstudents’ permission to use their images, Zuckerberg was brought before the university’s administrative board on charges of breaching computer security and violating Internet privacy and intellectual property policies. Zuckerberg took a leave of absence from Harvard after the controversy and then relaunched his site as a social application for Harvard students in 2004. The viral nature of the web site allowed it to grow quickly, and a year later Zuckerberg officially withdrew from Harvard to concentrate his efforts on developing what was first known as thefacebook.com.

Relaunched as Facebook in 2005, the social network quickly expanded to the rest of the Ivy League. Soon after, Facebook expanded dramatically across university and college campuses across the nation. Facebook’s focus on the college and university demographic helped catapult it into what any marketing manager will tell you is the most hard demographic to crack, the 18–24 young adult market. To keep its growing momentum, Facebook opened its doors to nonacademic users for the first time in 2007. Since this time, Facebook has grown to be the second largest social network with more than 30 million users. And with any growth comes opportunities both for the company and for its users.

Posted in Social NetworkComments (0)

Apple Set to Replace Google with Bing

Apple Is In negotiations with Microsoft to replace Google as the default search engine in both Safari and the iPhone, according to industry insiders. If you want to use Microsoft’s Bing at the moment, you need to go to bing.com.

apple-safari-whatsnew-history
apple-safari-whatsnew-history

The talks confirm just how much relations between Apple and Google, its erstwhile ally against Microsoft. have shifted. Until last August, Google CEO Eric Schmidt was still on Apple’s board of directors, but now the two companies are in direct competition in the smartphone, mobile advertising, browser sectors and, when Chrome OS appears, in the personal computer market.

‘Apple and Google know the other is their primary enemy.’ one insider told Businessweek. ‘Microsoft is now a pawn in that battle.’

Meanwhile, Schmidt recently attempted to tone down the perceived acrimony between Apple and Google. ‘I, as a former board member, have a special spot for Apple in my heart,’ he told financial analysts during a conference call. Apple is a very well run company. They have a lot of very excellent stuff coming. We have a couple of very excellent partnerships with them, and we also compete with them in a couple of areas. My guess is that is a pretty stable Situation for a while.’

For Microsoft, a deal would enable it to boost Bing’s market share, especially in the emerging mobile search market, where Google is less entrenched, and where the iPhone is the dominant hardware platform.

Although Apple and Microsoft. have been mortal enemies in the past, the two have also worked together when it suited them. Microsoft makes money selling Mac applications like Office, and in 1997 Apple made Internet Explorer the default web browser for the Mac in return for a $150 million (about £93 million) investment.

Apple’s choice to switch to Bing from Google could also just be a Question of Microsoft offering more money to have its search engine made the default for the iPhone and Safari, according to some industry analysts.

Others have speculated that Apple could adopt Bing as a stop-gap, while it develops its own search engine.

Posted in IT NewsComments (1)

Introduction to Facebook

In this article, you learn about the Facebook phenomenon, where it came from, and what you can do with it.

What Is Facebook?

facebook-logo-3
facebook-logo-3
Facebook is a social networking website. To flesh out this definition a bit more, it’s an online community—a place where people can meet and interact; swap photos, videos, and other information; and generally connect with friends, family, coworkers, fellow students, fellow hobbyists and enthusiasts, and numerous others in their social network. Facebook connects people within cities or regions, work or school, home or abroad, and so on. Built on an architecture of profile pages that allow individual users to share information about themselves and communicate with others, Facebook seeks to make an environment in which members log in regularly to keep track of what friends and colleagues are doing, share their own activities, interact about interests and leisure activities, send messages, and join groups and networks—just to name a few things.

Read the full tale

Posted in Social NetworkComments (5)

RT: @Microsyntax Sets Out To Make Sense Of #twittergrammar

One of the side effects of Twitter’s 140-character limitation is that users are coming up with their own microsyntax and abbreviated Twitter grammar to make their Tweets more expressive. If your are merely retweeting someone else’s tweet, for example, you acknowledge that by placing a “RT” at the beginning of your micro-message. If you are replying publicly to another user or just referring to them, you indicate that with an “@username.” You can even add hashtags to a tweet so that it shows up in searches for specific topics (please use “#twittergrammar” if you are going to RT this post).

New conventions pop up every day. To make sense of them, and develop new ones, Stowe Boyd is launching Microsyntax.org tomorrow. In a debut blog post, he insists that it is not a “standards body,” but that is effectively what it might become. And we need one, because Twitter isn’t setting any standards. You can follow @microsyntax to keep on top of the latest Twitter lingo.

Microsyntax is not just about coming up with commonly used abbreviations. It is also the way that structure can be added to the mess that is Twitter today. Hashtags, for instance, lets you find all tweets about a particular subject or event. We probably need more microtags for different purposes.

The problem with the microsyntax approach, but, is that it appeals mostly to the command-line crowd instead of to the average user. Nevertheless, if a microconvention becomes well loved enough, then Twitter itself can adopt it, as it has with the @answers (although it has messed that up by mixing in retweets that simply mention your name and aren’t truly answers, but I digress). What’s your favorite microslang and what do we need to add to the microlexicon?

Crunch Network: CrunchBoard because it’s time for you to find a new Job2.0


Posted in Company, TechnologyComments (0)

An Apple Mac Tablet Could Challenge Amazon.com’s Kindle

Apple could be rolling out a Mac Tablet in the first half of 2010, according to widely circulated Wall Street analyst report. While Apple has publicly shot down suggestions that it would enter the mininotebook or netbook market, the existence of a multitouch tablet device could represent a potential threat to Amazon.com, which anticipates making billions from its own flat-screen Kindle mobile e-reader devices.
– Rampant rumors have Apple
releasing a Mac Tablet computer with multitouch capability within the next
year. Such a release has the potential to challenge many competing companies in
both the PC and mobile device markets.
If the rumors of the tablet’s capabilities prove right, there is also
poten…


Posted in WiFiComments (0)

Deny This, Last.fm

A couple of months ago Erick Schonfeld wrote a post titled “Did Last.fm Just Hand Over User Listening Data To the RIAA?” based on a source that has proved to be very reliable in the past. All hell broke loose shortly thereafter.

Before posting Erick reached out to the RIAA, Last.fm and parent company CBS for comments. The only response was from CBS – “To our knowledge, no data has been made available to RIAA.” The CBS spokesperson, Katie Gunion, subsequently emailed us to say “would you please attribute the statement to Last.fm, it is currently reading as though CBS issued the statement” Gunion’s email lists her title as Public Relations, CBS Interactive, and her first statement did not name Last.fm (this is vital, see below). A subsequent statement by Shannon Jacobs, VP of Communications at CBS: “this is a last.fm issue, as far as I am concerned. It is not a corporate issue. This is a last.fm issue, not a corporate issue. The posting represents last.fm’s response.”

After the tale broke all concerned parties had no problem commenting publicly.

Last.fm cofounder Richard Jones said “I’m rather pissed off this article was published, except to say that this is utter nonsense and really untrue.” He followed up with a blog post “Techcrunch are full of shit, “I denied it vehemently on the Techcrunch article, as did several other Last.fm staffers. We denied it in the Last.fm forums, on twitter, via email – basically we denied it to anyone that would listen, and now we’re denying it on our blog.” One blog called us a “tabloid masquerading as a legitimate news outlet.” Lots of others piled on.

Apart from updating the original post we’ve been silent on this tale. The person who first leaked the news was terminated from CBS for the leak, says our original source, and threatened with legal action. He understandably went very silent. But the outrageously shrill denials by Last.fm just didn’t ring right. Once you got past the personal attacks, the denial language itself was too carefully worded.

Now we’ve located another source for the tale, someone who’s very close to Last.fm. And it turns out Last.fm was telling the truth when they said Erick’s tale wasn’t right.

Last.fm didn’t hand user data over to the RIAA. According to our source, it was their parent company, CBS, that did it. That corresponds to what our original source said in conversations we had after our initial post and before CBS lawyers became involved. But we didn’t want to update until we had an independent source for that information, too.

Here’s what we believe happened: CBS requested user data from Last.fm, including user name and IP address. CBS wanted the data to comply with a RIAA request but told Last.fm the data was going to be used for “internal use only.” It was only after the data was sent to CBS that Last.fm learned the real reason for the request. Last.fm staffers were outraged, say our sources, but the data had already been sent to the RIAA.

Here’s an email from the original source, partially redacted. A screenshot of this email is here.

Re: touching base

From: [redacted, a CBS employee]
Sent: [redacted]
To: [redacted]

[ _____] We provided the data to the RIAA yesterday because we know from experience that they can negatively impact our streaming rates with publishers. Based on the urgency of the request they probably just wanted to learn more about the leak but who knows. Seriously, can you blame them? [______] Our ops team provided the usual reports along with additional log data including user IP addresses. The GM who told them to do it said the data was for internal use only. Well, that was the huge mistake. The team in the UK became irate because they had to do it a second time since we were told some of the data was corrupted. This time they transferred the data directly to them and in doing so they learned who really made the request. Shit really hit the fan, I even got a call [______] Obviously, I can see their POV but what they don’t know over there is that we are in the analytics business and it’s not like this is the first time we’ve provided this data to a third party. Someone over there should be more forthright with users about the data policy instead of complaining about BD to upper management like I’m here trying to ruin the business. We’re just trying to help them stay afloat here it’s not like Pro memberships are earning any revenue! [______________] So if you hear of anything, I’m even open to possibly moving West now for the right opportunity, let me know.

Our new source, which hasn’t seen this email, says much the same: that Last.fm didn’t know the nature of the CBS request until after the data was sent and that the data was in fact subsequently sent by CBS to the RIAA. This source’s information comes directly from Last.fm employees who he has spoken with.

It’s vital to note that while sources are in agreement that it was the RIAA that made the request, it may have been one or more music marks acting independently. The suggestion in the email above that the compliance was made because of the ability for the requester to negatively impact streaming rates suggests it was a mark request. But the end result is the same.

We believe CBS lied to us when they denied sending the data to the RIAA, and that they subsequently questioned us to attribute the quote to Last.fm to make the statement defensible. Last.fm’s denials were strictly speaking right, but they ignored the underlying truth of the situation, that their parent company supplied user data to the RIAA, and that the data could possibly be used in civil and criminal actions against those users. We believe that the outrage they aimed at us for reporting the tale, which was materially right, should have been aimed at CBS instead. But Last.fm never spoke publicly of the real facts of the tale.

We believe Last.fm and CBS violated their own privacy policy in the transmission of this data. We also believe CBS and Last.fm may have violated EU privacy laws, including the Data Protection Directive, and should be investigated by the appropriate authorities.

And to the CBS employee who was fired and threatened based on this tale – we believe certain U.S. Whistle Blower laws may protect you from retaliation from CBS in this matter. We’d like to provide you with legal counsel at our cost.

Crunch Network: MobileCrunch Mobile Gadgets and Applications, Delivered Daily.


Posted in Company, TechnologyComments (0)

Google’s Beta Love May Die In Fight For Enterprise Customers

Being in Beta is cool. So cool that five years after its April 2004 launch Gmail is still held in Beta by Google. That’s despite the fact that it has 146 million users worldwide (Comscore, April 2009). Which is sort of ridiculous.

Now we’re hearing that Google is having an internal debate about removing the Beta logos from a number of products that are aimed at enterprise customers.

About half of Google’s products were still in Beta at the end of 2008. Retaining the Beta notation in the logo gives the company a sort of get-out-of-jail-free card when problems occur. Hey, it’s still in Beta, so don’t be surprised when something goes incorrect.

There’s a problem though. Sure, users reckon Beta is geeky and fun and cutting edge. But it turns out that enterprise customers are a small more serious about stuff working. A Beta tag means what it’s supposed to mean – not fully baked. Stuff that isn’t fully baked has risks, and guys that run IT at companies aren’t fans of risk. They need things locked down. And while they’re smart enough to know that Google’s Betas aren’t really Betas, they aren’t going to take a risk. If something goes incorrect it’s their fault.

That’s why Google took Chrome out of Beta just a couple of months after it was first released. OEMs need release software to install it on PCs, so they had to go it along. Marissa Mayer talked about Google Betas in general, and Chrome specifically, at the Le Web conference in Paris last December – the relevant clip is below.

Don’t look for Google to give up their like of Betas in general. But they may remove the Beta notation from a number of Google Apps services, which are aimed at enterprise customers, sometime soon. A source first tipped us off that a debate was going on at Google, and we’ve subsequently confirmed it. Some top execs feel strongly that the Google Apps products need to have the Beta notation in their logos removed to get some enterprise customers to even consider switching from Microsoft Office.

Four of the five core Google Apps services are still in Beta: Gmail, Google Docs, Google Talk and Google Calendar. Google Sites, previously Jot, is the lone exception. We may see those Beta notations coming down soon, though. Stay tuned.

Crunch Network: CrunchBase the free database of technology companies, people, and investors


Posted in Company, TechnologyComments (0)

Acer Plans Android Smartphone in 2009

Acer plans to introduce a smartphone that uses Google’s Android operating system at the end of 2009. Acer is already plotting a number of smartphones that use the Microsoft Windows Mobile OS.
– PARIS (Reuters) Acer Inc, the world’s third-largest PC brand, plans to
introduce a phone model running on Google’s Android software this year, the
head of its phone unit said on Wednesday.
The company plans to sell this year around 10 models, with all but one using
Microsoft’s Windows Mobile sof…


Posted in WiFiComments (0)

Page 1 of 1312345...10...Last »