Cappy Popp’s Slides from GSP East: ‘Migrating from Facebook to Bebo’
Here are my slides from my presentation this morning at GSP East. Please let me know if you have any questions.
You can also get them on slideshare here.
Here are my slides from my presentation this morning at GSP East. Please let me know if you have any questions.
You can also get them on slideshare here.
Here is my slide deck from GSP East workshop on creating a Bebo Application.
Link to Slideshare.com. The notes for each slide contain additional information useful in building your first application.
Post any questions below or on the Bebo Forums.
John Maver and Cappy Popp will be presenting at the GSP East Intro To Facebook and Bebo Applications workshop at 9:00 on Monday, June 9th in Washington, DC. Stop by and say hi, if you are there.
http://en.oreilly.com/gspeast2008/public/schedule/detail/3272
I have been answering a lot of email requests for how to get started with a Bebo application. Since applications can be written in any language that supports interaction with the Bebo REST API, developers have a lot of choices in how they build their application. The focus of this article will be on the "officially supported language" - PHP. I saw officially supported, because the Bebo Platform Team has released a simple PHP wrapper that makes using the REST API very simple, and they update this from time to time.
Before creating an application, you need to understand the parts of an application and how they interact with Bebo. I will go over each part below, and then show an example of a very simple application that uses each part.
The Bebo URL - this is the URL that users go to on Bebo. It is in the format "http://apps.bebo.com/yourapp/"
The Callback URL - this is the URL on your server that Bebo redirects to. It is where the actual application lives.
The Canvas Page - this is the main page of a Bebo application. It takes up the entire web page, except for the Bebo top header and footer. User's going to your canvas page are using your server directly via the callback URL. Canvas pages can either be written in SNML, a markup language that is standardized across Facebook and Bebo and is fast to load, or in an iFrame. Javascript is only allowed in iFrame based applications, but they cannot use SNML.
The Profile Box - each application can create a presence on the installing user's Profile page. This contents of this box are set by the application, but when the user is seeing this Profile box, it is running a cached version on Bebo's servers. The user can click links or interact with Flash to go to the canvas page or call back to your server using simple AJAX. Since browsing other people's Profiles is one of the main activities on Bebo, creating a compelling Profile Box is a very important part of helping your application to spread.
Invitations - each application can provide a way for users to recommend it to their friends. Bebo provides a common dialog for selecting friends, and limits the total number of invitations that can be send per person per day. You can control some of the text that the inviter sees when selecting their friends, and some of the text in the actual invitation. Your application must give the user a reason to want to send an invitation, either by being innately good, or by some type of reward system for invited friends.
News Stories - applications can produce news stories based on how the users interact with the application. These stories appear on the user's Profile page in the news section. Bebo will also show the most interesting stories from a user's friends on their home page. News stories should be interesting and actionable in order to help your application spread and provide value to the user.
require_once "bebo.php";
$appVisibleName = "Example App"; $appApiKey = 'copy API Key from the developer application page'; $appSecret = 'copy API Secret from the developer application page'; $appCallback = 'put in your callback url. Ex - http://myserver.com/favoritebirds/ '; $appBeboURL = 'put in the Application URL above - http://apps.bebo.com/favoritebirds/';
$bebo = new Bebo( $appApiKey, $appSecret ); $userID = $bebo->require_add();
displayPage($bebo); function displayPage($bebo) { $userID = $bebo->user; $output = "Welcome back, <sn:name uid='$userID' useyou='false' />.<br/> You have a nice picture:<sn:profile-pic uid='$userID' linked='false'/>"; echo $output; }
You now have a fully functional Bebo application. But, let's add some more features.
updateProfile($bebo); function updateProfile($bebo) { global $appVisibleName; $userID = $bebo->user; $snml = "This is the $appVisibleName profile box of <sn:name uid='$userID' useyou='false' /> <br/><sn:profile-pic uid='$userID' size='square' linked='false'/>"; $bebo->api_client->profile_setSNML($snml); }
publishStory($bebo); function publishStory($bebo) { global $appVisibleName; global $appBeboURL; $actor = $bebo->user; $title_template = "{actor} used <a href='$appBeboURL'>$appVisibleName</a>"; $title_data = null; $body_template = null; $body_data = null; $body_general = "Everyone should try $appVisibleName. <a href='$appBeboURL'> Install $appVisibleName today.</a>"; $image1 = null; $image1Link = null; try { $result = $bebo->api_client->feed_publishTemplatizedAction( $actor, $title_template, $title_data, $body_template, $body_data, $body_general, $image1, $image1Link, NULL, NULL, NULL, NULL, NULL, NULL, ""); } catch( Exception $ex) { } }
$invitePageURL = getInvitePageURL($bebo); echo "<a href='$invitePageURL'>Would you like to invite some friends?</a>"; function getInvitePageURL($bebo) { global $appApiKey; global $appBeboURL; global $appVisibleName; $beboInvitePage = "http://www.bebo.com/multi_friend_selector.php"; // What the inviter sees $actionText = urlencode("Which friends do you want to invite?"); $action = $appBeboURL; $type = urlencode("Invite"); // What the recipient sees $acceptInviteButtonURL = $bebo->get_add_url($appBeboURL); $acceptInviteButtonLabel = "Add $appVisibleName"; $acceptInviteButton = "<sn:req-choice url='$acceptInviteButtonURL' label='$acceptInviteButtonLabel' />"; $content = urlencode("Hey, try out $appVisibleName. $acceptInviteButton"); $sig = 0; // update with the signature tool. This is a two step process. Generate the url for the invite page // Then go to http://www.bebo.com/AppToolSig.jsp and paste it in. At the bottom, you will get a signature. Update the value above. // If you change the invite text, you will have to regenerate the sig above $invitePageURL = "$beboInvitePage?sig=$sig&api_key=$appApiKey&content=$content&type=$type &action=$action&actiontext=$actionText&invite=true"; return $invitePageURL; }
Here is the completed sample:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php date_default_timezone_set("America/New_York"); require_once "bebo.php"; // Global definitions for your app $appVisibleName = "Favorite Birds"; $appApiKey = "copy API Key from the developer application page"; $appSecret = "copy API Secret from the developer application page"; $appCallback = "http://myserver.com/favoritebirds "; $appBeboURL = "http://apps.bebo.com/favoritebirds/"; ///Main Entry Point /// // Force everyone to add the application. // If they have already added it, then display the page $bebo = new Bebo( $appApiKey, $appSecret ); $userID = $bebo->require_add(); displayPage($bebo); // Update the user's profile updateProfile($bebo); // Publish a news story publishStory($bebo); ///End Main Entry Point /// function displayPage($bebo) { $userID = $bebo->user; $output = "Welcome back, <sn:name uid='$userID' useyou='false' />.<br/> You have a nice picture:<sn:profile-pic uid='$userID' linked='false'/>"; // Add the link to the invite page $invitePageURL = getInvitePageURL($bebo); $output .= "<br/><a href='$invitePageURL'>Would you like to invite some friends?</a>"; echo $output; } // returns the url for the Bebo standard invite page function getInvitePageURL($bebo) { global $appApiKey; global $appBeboURL; global $appVisibleName; $beboInvitePage = "http://www.bebo.com/multi_friend_selector.php"; // What the inviter sees $actionText = urlencode("Which friends do you want to invite?"); $action = $appBeboURL; $type = urlencode("Invite"); // What the recipient sees $acceptInviteButtonURL = $bebo->get_add_url($appBeboURL); $acceptInviteButtonLabel = "Add $appVisibleName"; $acceptInviteButton = "<sn:req-choice url='$acceptInviteButtonURL' label='$acceptInviteButtonLabel' />"; $content = urlencode("Hey, try out $appVisibleName. $acceptInviteButton"); $sig = 0; // update with the signature tool. This is a two step process. Generate the url for the invite page // Then go to http://www.bebo.com/AppToolSig.jsp and paste it in. At the bottom, you will get a signature. Update the value above. // If you change the invite text, you will have to regenerate the sig above $invitePageURL = "$beboInvitePage?sig=$sig&api_key=$appApiKey&content=$content&type=$type&action=$action&actiontext=$actionText&invite=true"; return $invitePageURL; } function updateProfile($bebo) { global $appVisibleName; $userID = $bebo->user; $snml = "This is the $appVisibleName profile box of <sn:name uid='$userID' useyou='false' /> <br/><sn:profile-pic uid='$userID' size='square' linked='false'/>"; $bebo->api_client->profile_setSNML($snml); } function publishStory($bebo) { global $appVisibleName; global $appBeboURL; $actor = $bebo->user; $title_template = "{actor} used <a href='$appBeboURL'>$appVisibleName</a>"; $title_data = null; $body_template = null; $body_data = null; $body_general = "Everyone should try $appVisibleName. <a href='$appBeboURL'>Install $appVisibleName today.</a>"; $image1 = null; $image1Link = null; try { $result = $bebo->api_client->feed_publishTemplatizedAction( $actor, $title_template, $title_data, $body_template, $body_data, $body_general, $image1, $image1Link, NULL, NULL, NULL, NULL, NULL, NULL, ""); } catch( Exception $ex) { } } ?>
The example above just forces everyone to add, but isn't able to specially handle new installs or removals. You can handle those by looking at the $_REQUEST parameters that Bebo passes your application. These parameters show that users come to your application in 1 of 3 states:
By changing the block marked ///Main Entry Point /// above to one that detects the state, you can handle each one differently. You will need to add new functions to handle new user installs and uninstalls
///Main Entry Point /// // An existing user will have the fb_sig_in_canvas variable set, unless they are removing if (isSet($_POST) && isSet($_POST['fb_sig_in_canvas'])) { // Bebo will pass their user id and that they have added the application if ( isSet($_POST['fb_sig_user']) && $_POST['fb_sig_added'] == 1 ) { $userID = $_POST['fb_sig_user']; // If the user has just installed, Bebo will pass installed as a GET parameter if ( isSet($_GET) && isSet($_GET['installed']) ) { newInstall($userID); } // Normal users will go through here, so display the page $bebo = new Bebo( $appApiKey, $appSecret ); displayPage($bebo); // Update the user's profile updateProfile($bebo); // Publish a news story publishStory($bebo); } } // If you set up your own post add handler, then you must handle the add request the way you want, // and then redirect back to your Bebo URL. If you don't specify a post add handler, Bebo does this for you. else if ( isSet($_GET) && isSet($_GET['installed']) ) { $bebo = new Bebo( $appApiKey, $appSecret ); newInstall($bebo ); $bebo->redirect($appBeboURL); } // If you specify a post remove URL, then Bebo will call it with this POST variable. // After this call, you won't get anything else from this user unless they re-add your application else if ( isSet($_POST) && isSet($_POST['fb_sig_uninstall']) ) { $userID = $_POST['fb_sig_user']; uninstallUser( $userID); } // If the user goes to your callback URL directly, they didn't come in from Bebo, and you will have no information about the user // In most cases, you will just want to force the user to add the application by using require_add. This will force them back through // the existing user path above else { $bebo = new Bebo( $appApiKey, $appSecret ); $bebo->require_add(); } // Handle a new user installation function newInstall($userID) { // We can use the SNML to say hello to the user $output = "Hello, <sn:name uid='$userID' useyou='false' />. Thanks for adding the application!"; echo $output; } function uninstallUser($userID) { // You can't actually display anything to the user, or redirect them. // All you can do is clean up inside your application. } ///End Main Entry Point ///
Thought Labs provides custom software development and consulting services with a specialization in Social Network technologies. We build branded Facebook Pages for your company or multiple Pages for your various products. In addition, we create rich interactive applications on your Page to help users find your products and services. Thought Labs can also create custom Facebook, Bebo or OpenSocial applications carrying your message and your brand with them.
We pride ourselves on the quality of our work. We employ top application developers who are creative, highly skilled, up-to-date on the Social Networks' constantly changing APIs, and excellent at project management. We set high standards for ourselves and we meet them. In this new world of social marketing, Thought Labs delivers extremely innovative, high-quality work on time and on budget. Find out more at http://www.thoughtlabs.com.
fb:ref is a way to set a placeholder on a bunch of user profiles, and then update it across all those profiles with a single call. It makes sense to use when you have data or images that would need to be updated occasionally, but are not specific to the current viewing user. Some examples would be banner, application news updates, or perhaps an entire theme for a profile box.
You can have multiple fb:ref's - they are keyed off the one of two things:
Below, I will show steps for implementing the callback method:
$fbml = "<fb:ref url='http://yourserver.com/callbackurl' />";
$facebook->api_client->profile_setFBML("", NULL, $fbml, "", "");
on Bebo it would be:
$snml = "<sn:ref url='http://yourserver.com/callbackurl' />"; $bebo->api_client->profile_setSNML($snml , $userid);
For the callback url, you can either use a unique page or just pass a GET parameter that you can check for later like this:
<fb:ref url='http://yourserver.com/yourapp/callbackurl/?refcallback=1' />
if ( isset($_GET['refcallback']) ) {
$text = "
<div>
<img src='http://yourserver.com/yourapp/someimage.jpg'/>
</div>
";
echo $text;
}
$refreshURL = "whatever you used for the sn:ref above";
$facebook->api_client->fbml_refreshRefUrl("$refreshURL");
on Bebo it would be:
$refreshURL = "whatever you used for the sn:ref above";
$bebo->api_client->snml_refreshRefUrl("$refreshURL");
One of the first questions we usually are asked by potential clients of Thought Labs involves ROI (return on investment.) It is a valid and critical question, no matter the size of the company or its marketing budget. It's the yardstick used when evaluating the success of a traditional media campaign, so why not expect the same rules to hold true for social media? How can one be sure in the changing world of the web and online marketing that their dollar will have an impact on their bottom line? Will their investment increase brand recognition, generate leads, or increase their market penetration? Unfortunately there is currently no 'silver bullet' of measurement that can demonstrably prove ROI for a social media investment. There are startups working feverishly on the problem, to be sure, but the state of affairs today requires a different approach and restatement of the problem.
This approach is based on setting and meeting a set of clearly defined objectives rather than using measurements in the traditional sense, though some of them may still be valid. Companies have to ask themselves a very simple question: "Why are we investing in social media, and what would we consider a successful result?" It seems trite, in a way, but it is critical to understanding the new meaning of ROI. It's not about return on investment anymore. It's all about gaining influence or leverage for your investment and measuring the return on that influence. Influence is the key concept at the core of social media. Peer/friend opinions and reviews hold more sway than any other. Brands can be created in an instant and just as quickly destroyed when you are dealing with the economies of scale and the numbers of users involved on social networks such as Facebook and MySpace. But social media encompasses so much more. Myriad online communities exist and all are potentially valid social media outlets. Companies need to understand that by focusing only on the immediate effect on their bottom lines they may be missing the point.
One other area that companies need to understand is the new concept of 'engagement' as it applies to their social and new media strategies. What is 'engagement?' That's the million- or perhaps billion-dollar question. There is no metric for it that means the same thing to everyone. One interesting equation of sorts has been proposed by socialmedia:
E = mc^2
...which means:
Engagement = media buy * (creative ^ 2)
I agree in a sense. Creativity is STILL KING. You can spend millions on your media buy to get your social media prodcut noticed. But, if it's not creative (or for you math geeks as creativity approaches 0) your engagement tanks. It's simple, but critical to understand this. True, this all depends upon your objectives. You have to put your social media assets in context: if you are looking for tons of repeat users (i.e. page views, visits, etc.) and engagement is near zero, FAIL.There are enough single-use social media apps and widgets out there that support this hypothesis that it's not worth expanding upon. If you want your clients to come back, you need to interact with them. You have to engage them to make them come back.This is critical for both growing brands and generating leads. The traditional marketing funnel is still relevant - but the rules that govern the journey from one end of it (eyeballs on your content) to the other (the buy) have changed.
Another thing companies need to Think of it as an extension of the 80/20 rule. In the past when content was put on the web you could expect about 80% of your audience to see that content within a short period of time. If your spend was X at some specific or measured CPM you could expect some specific results based on traditional measurements. This is no longer the case with social media. Now, you can expect about 20% of your media to be viewed (if you're lucky) and over time, if you're influence and engagement are high enough, you can expect that 80% to come trickling - or ideally virally pouring - in after it's available for some time. It's not a linear graph anymore. You hope it's exponential. But it's not guaranteed.
It's about creating a social media campaign that is relevant to YOUR business and your needs. No one can do it for you if you don't understand why your business is playing in the social media space in the first place.
So:
It's all about the conversation now. Be a part of it. Don't fight it or you will lose.
Tags: social media, facebook, myspace, opensocial, marketing, ROI
I have been spending a lot of time over the past few months trying to actively participate in the Bebo Developer forums. After working on the Inner Circle and Doorbell applications for Facebook, I had learned a lot about the platform. As I worked to port those applications over to Bebo, I thought that I could help others on the new Bebo platform get going as well.
A week ago, I got an email from the Bebo Platform Team telling me that I had been selected as the “featured developer” on the Bebo Developer Site. I am very flattered. The Bebo Platform team is a very hardworking set of people, and I look forward to continuing to interact with them and with the Bebo Developer Community in the future.
Bebo is still working on fixing performance problems, and the applications are still down. In a blog post today, the Bebo developers talked about some features that they will be releasing in the near future.
This sound great for encouraging the spread of applications, but I worry that, like on Facebook, abuses of the system will render it mostly useless. Facebook has implemented limiting features to cut down on the spam, but the Bebo developers made no mention of implementing them on Bebo.
Bebo posted this today:
Bebo is slow. Sorry! It's been growing a lot recently and we're not quite keeping up with the demand. Even though apps has nothing to do with the problem, we turned off apps temporarily to help reduce the load. We're working hard on a permanent fix and hope to have it all working fast again soon.
This means, of course, that Doorbell and Inner Circle for Bebo are down. The good news is that the Bebo developers seem to generally be on top of their game, so I don’t expect this to last too long.
The Facebook API does have a way to set and get cookies, but it is in beta so is not currently part of the FB PHP libraries. I found it out by searching through forums, by trial-and-error, and on the FB Beta docs page. There are 2 functions available:
data.getCookies( user_id, cookie_name ); data.setCookie( user_id, cookie_name, cookie_value, expires, path );
To use these functions from PHP I simply wrapped them in functions that call the RESTful APIs correctly:
// to get cookies for a given user (optionally by name): function get_cookie($uid, $name=null) { global $facebook; return $facebook->api_client->call_method('data.getCookies', array('uid' => $uid, 'name' => $name) ); } // to set a cookie for a given user: function set_cookie($uid, $name, $value, $expires=null, $path=null){ global $facebook; return $facebook->api_client->call_method('data.setCookie', array('uid' => $uid, 'name' => $name, 'value' => $value, 'expires' => $expires, 'path' => $path) ); }