Latest Updates: Facebook RSS

  • Add app to Facebook page

    Ellen 16:46 on May 30, 2012 | 0 Permalink | Reply
    Tags: Facebook, Facebook app,

    If you want to add your app to a Facebook page, you will have to do the following.

    1. Prepare your app

    Make sure your have has valid URLs to point to from the little thumbnail in the Facebook page. Add an image that will be displayed. To fit the image into the area on the Facebook page it needs to be 111 x 74 px.

    add_app_facebook_page

    2. Add the app
    To add the app to the page you need to run the following link:

    https://www.facebook.com/dialog/pagetab?app_id=[APP_ID]&next=[PAGE_TAB_URL]

    The app id can be found https://developers.facebook.com/apps/
    facebook_app_your_app
    3. Add page tab dialog
    The page tab dialog will show all the pages you have admin permissions to.
    add_page_tab_facebook

  • Notes from Facebook Garage in Stockholm

    Ellen 13:40 on May 26, 2012 | 0 Permalink | Reply
    Tags: , Facebook

    facebook_garage_stockholm

    Tagging users
    Application can tag people in updates. Permissions needed.
    The application can add a personal message to the update and also add it after the action was published.

    User generated photos
    It is now possible to post large photos in the news feed even without uploading it to a Facebook album.
    The difference is that the image is uploaded to your own server. The image URL is then passed to the Open Graph together with other optional values like:
    sources – Image URL
    large – If the image should be big (boolean)
    expires_in – How long the post should exist (seconds)
    tags – User ids in array to pass tagged users
    message – Your personal message
    place – Id of Facebook place
    your own actions – Verbs

    Post it to the graph with /me/[namespace_of_app]:your_action

    Download the example application here: https://bitbucket.org/brucehazan/ios-sample-og
    Example includes single sign in with Facebook iOS SDK.

    Add app from Timeline
    If friends are using a Facebook app and a post appears in your news feed and you don’t have the app, you can install the app in a click of a button. The button on the post says “Add app”.
    To enable it put a URL in Profile URL in application settings.

    Publish past on user timeline
    Post past things on the users timeline
    Button to fill out past timeline

    Map Stories
    Specify long and lat on a page can be added in meta tags. Your post can be associated with a location.

    New Feed Aggregations
    The more traffic a post gets it gets highlighted in the news feed.

    Action links on OG Stories
    Accept Diff – Authenticate the application to display application-functionality in the post:
    https://developers.facebook.com/docs/opengraph/actionlinks/

    Permissions
    offline_access – Depreciated
    Valid for 60 days is the only thing that can be used. As long as the user used your app you have 60 days to access the user.

    publish_stream includes publish_actions by default now.

    iOS Deep Linking
    It is possible to deep link into an iOS app from posts of the mobile Facebook app. If the user doesn’t have the app, the user will be directed to the App Store. After installing it the deep link is active.
    This is not new but it just launched for Android.
    To enabled it just check the box of iOS Native Deeplinking in your Application settings.

    Facebook requests
    Facebook requests from Facebook applications can be sent directly to the iOS device linking the user directly to your native iOS app with Facebook integration.

    App Center
    Facebook launched the App Center where all Facebook apps are shown in an App Store-like matter. The apps will show screenshots and rating from users.

  • How to add Facebook like buttons to your tab

    Ellen 17:06 on January 4, 2011 | 1 Permalink | Reply
    Tags: Facebook, , fbml,

    facebook_likes

    Since late last year it is now possible to add Facebook Like buttons to Static FBML tab on your Facebook page. You can add as many as you like as long as the have a unique “xid” parameter for each like button. “returnurl” is the parameter for the URL you want users to like. The code for one like button looks like this:

    // Code for my Like button

    Showing only the Like button

    Style sheet at the top has been added to hide elements which is included in the fb:comments set, this set displays Facebook’s comments functionality by default. Make sure to place the css above your FBML tags.

    • “.comment_body” displays the comments.
    • “.subtitle_left” displays a small Facebook icon with the text “Facebook social plugin” below the Like button.

  • Post to Facebook with Javascript SDK

    Ellen 13:55 on December 21, 2010 | 0 Permalink
    Tags: Facebook, , ,

    Posting a message to someones wall can contain the following parameters:

    var my_message = ‘This is just a test!’;
    var url = ‘http://www.sundh.com/’;
    var title = ‘This is the name of my post’;
    var desc = ‘Optional description of my link’;
    var picUrl = ‘http://www.sundh.com/blog/images/led.jpg’;

    To post the following to my wall this javascript code is executed:

    FB.api(‘/me/feed’, ‘post’, {message:my_message,link:url,name:title,picture:picUrl,description:desc },
    function(response) {
    if (!response || response.error) {
    alert(‘Error occured’);
    } else {
    alert(‘Post ID: ‘ + response.id);
    }
    });

    If I decided to not define the parameter “description” the post will grab the text appearing on the URL.
    facebook_post

    Youtube clip

    Posting a YouTube clip to someone’s wall requires a little bit different code in order to be able to play the YouTube clip within Facebook. Note that the URL to the YouTube clip is different from the URL shown in the browser when you watch the clip. Instead of “http://www.youtube.com/watch?v=VIDEO_ID”, it is set to “http://www.youtube.com/v/VIDEO_ID”. The thumbnail of the YouTube clips is easly retreived by accesing the URL “http://img.youtube.com/vi/VIDEO_ID/0.jpg”.

    var my_message = ‘My message here’;
    var url = ‘http://www.youtube.com/v/VIDEO_ID’;
    var title = ‘Title of YouTube clip’;
    var desc = ‘Description of YouTube clip’;
    var picUrl = ‘http://img.youtube.com/vi/VIDEO_ID/0.jpg’;

    The trick that makes the YouTube clip embeddable on Facebook is to add the parameter “source” in you API call to Facebook. The source is the same as the URL to the video clip.

    FB.api(‘/me/feed’, ‘post’, {message:my_message,link:url,name:title,picture:picUrl,source:url,description:desc }, function(response) {
          if (!response || response.error) {
            alert(‘Error occured’);
          } else {
            alert(‘Post ID: ‘ + response.id);
          }
        });

    The result looks like this:
    facebook_youtube

  • Like button on dynamic urls

    Ellen 11:02 on December 1, 2010 | 0 Permalink
    Tags: Facebook,

    I mentioned in the previous post how to sort your the number of likes of different URLS. In some cases you might wanna sort urls of the same domain to see the post popular post, the most popular product in your web shop or what have you. In order to have several Like buttons on one page each Like button needs to point to a unique URL, in many cases this is a dynamic URL generated to display the unique content.

    For Facebook to recognize the dynamic page as a unique page it helps to set their meta tags:

    <meta property="og:title" content="My dynamic title"/>
    <meta property="og:type" content="article"/>
    <meta property="og:url" content="http://www.mydomain.com/page.php?id=my_dynamic_url"/>
    <meta property="og:image" content="http://www.mydomain.com/unique_image_for_the_url.jpg"/>
    <meta property="og:site_name" content="My site name"/>
    <meta property="og:description"content="My unique description for the dynamic url"/>

    Proof test your URLs here: Facebook URL Linter

  • Get likes on urls from Facebook

    Ellen 18:01 on November 30, 2010 | 21 Permalink | Reply
    Tags: Facebook,

    Sometimes you might wanna list things on your site order by the popularity on Facebook. It can also be a handy tool compare your different sites Facebook likes and get social stats from it. Facebook offer a very handy service to check this without being logged in to Facebook in any way. Check the service we use here. Facebook will retreive all Facebook likes, share count and total counts of these. For each link, it will display:

    <link_stat>
    <url>http://www.google.com</url>
    <share_count>295804</share_count>
    <like_count>153002</like_count>
    <comment_count>177545</comment_count>
    <total_count>626351</total_count>
    <click_count>265614</click_count>
    <normalized_url>http://www.google.com/</normalized_url>
    <comments_fbid>381702034999</comments_fbid>
    </link_stat>

    Get total likes on urls

    With a loop in php we can get the information we need:

    function getLikes($arr){
          $urls = "";

          // Add urls to check for likes
          for($i = 0;$i < count($arr);$i++) {
                if($urls != "") $urls .= ",";
                $urls .= $arr[$i];
          }

          // Retreive info from Facebook
          $facebookapi = "http://api.facebook.com/restserver.php?method=links.getStats&urls=" . $urls;
          $xml = simplexml_load_file($facebookapi);

          $likes = array();
          // Loop through the result and populate an array with the likes
          for ($i = 0;$i  < count($arr);$i++) {            
                $url = $xml->link_stat[$i]->url;
                $counts = (int)$xml->link_stat[$i]->like_count;
                $likes[] = array("likes" => $counts, "url" => $url);
          }

          return $likes;

    }

    // Array with links to the URLs we want to get number of likes from
    $array = array("http://www.google.com","http://www.apple.com","http://www.facebook.com");
    $likes = getLikes($array);

    foreach ($likes as $key => $val) {
          echo $key . " => " . $val["url"] . " => " . $val["likes"] . "<br />";
    }

    Sorting the likes

    After retrieving the likes, the array can be sorted by most popular url.

    $likes = array_sort($likes, "likes", SORT_DESC);

    foreach ($likes as $key => $val) {
          echo $key . " => " . $val["url"] . " => " . $val["likes"] . "<br />";
    }

    Download source

  • Add Facebook Connect to your blog comments

    Ellen 11:09 on December 15, 2009 | 0 Permalink | Reply
    Tags: comments, Facebook, ,

    This neat video explains how you can add Facebook Connect to your blog and let users add comments by logging into Facebook Connect! No server-side scripting needed!

  • Hooked on Café World?

    Ellen 16:06 on December 8, 2009 | 0 Permalink | Reply
    Tags: Facebook, games, zynga

    New to Café World? It is one of many games made by Zynga. The game can only be played on Facebook and you can invite your friends on Facebook. From today the game hs more users than Twitter and the number of users have rapidly increased over a week. Read more about it here!
    http://www.insidesocialgames.com/2009/10/08/zyngas-cafe-world-goes-from-0-to-8-6-million-users-in-a-week-with-big-implications/

    My cafe:

    Café

    Café

  • Prefill Facebook private messages

    Ellen 15:02 on October 24, 2009 | 0 Permalink | Reply
    Tags: Facebook,

    I just found this neat little feature on Facebook which allows you to send prefilled messages to a person on Facebook.

    Fill in:

    id (must be the number id)
    subject (string)
    message (string)

    The whole link looks like this:

    http://www.facebook.com/inbox/?compose&id=652519918&message=I%20am%20writing%20to%20you..&subject=Just%20checked%20your%20blog!

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel