Facebook Cookbook - Jay Goldman [21]
Discussion
Users have the option of allowing your app to display a Profile Box on their Boxes page when they install it (this is enabled by default), and they can then reorder and resize the box by dragging it up or down and from the wide to narrow column. As an app developer, you get to decide where your box goes by default and can build different layouts for both. Compare, for example, the difference between the Zerofootprint Calculator’s two Profile Boxes, shown in Figures 2-16 and 2-17.
Figure 2-16. Profile Box (wide)
Figure 2-17. Profile Box (narrow)
The mid-2008 Profile redesign introduced a third size of box, which can reside in the left sidebar of the main Wall tab and is height-limited to 250 pixels. If your app includes a box of that size, your users can choose to add it to their main Wall tab instead of only on their Boxes tab.
Info Sections
Problem
I have some great structured data about my users, and I’d love for them to be able to publish it on their Profiles.
Solution
The Info tab, which debuted in the mid-2008 Profile redesign, gives apps the ability to publish structured data about users. Info sections are 540 pixels wide (including padding) and are dynamically sized vertically to fit your content. Your section will have a 25-character bolded title across the top, and Facebook will render a See All link if there’s more content than will fit.
Your Info section is made up of field/value pairs, with each field’s label being about 30 characters long (try to keep them to one line if possible). Facebook will automatically adjust the case of your title and add a colon (:) to the end if you forget. Values can be made up of text blocks (which you’ll tokenize and add hyperlinks to) or objects (which can include pictures).
Discussion
The Facebook Groups app shows a good text-based section, as shown in Figure 2-18.
Figure 2-18. Mary Treseler’s groups (my editor!)
The Facebook Pages app renders a good example of an object-based section, shown in Figure 2-19.
See Setting Info Sections for more information on setting Info sections.
Figure 2-19. Facebook Pages Info section
News Feed and Mini-Feed
Problem
How can I get my users to spread the good word about my app to their friends?
Solution
If success on Facebook is all about getting your message spread around the social graph, then the News Feed is your primary target. Think of it as the play-by-play announcer in a giant game of tag: almost every action you take on Facebook generates an item that appears in the Mini-Feed on your Profile. If it just stopped there it would still be a useful message-spreading tool, but luckily for us, the fun has just begun! Those same items can also appear in your friends’ News Feeds on their home pages, announcing everything you’ve done to everyone who cares.
Facebook processes over a billion News stories per day, running them through a super-sophisticated algorithm that determines which tidbits about your friends will turn up in your Feed. The end result is that your app can publish one story about each user every 12 hours, all of which will appear in that user’s Mini-Feed and some of which will get broadcast out to their friends via the News Feed.
Discussion
My News Feed (Figure 2-20) contains some subset of the stories that have been published about my friends, as determined by Facebook’s top-secret algorithm, likely created by a crack team of ninjas and Tibetan monks.
Figure 2-20. My News Feed (names blurred to protect the not-so-innocent)
As seen here, the Feed includes the icon of the application that published the story (in this case, Groups, Notes, Posted Items, Events, and Wall). Posts can include a title and a body (the Groups story only has a title, and the rest have both), and up to four images, which will be resized to fit within a 75×75 pixel area and cached by Facebook.
Each Facebook user also has a Mini-Feed, which appears as part of the Profile (see