views:

718

answers:

1

I just want a simple a way to grab the number of fans. I can do this on the serverside with python preferably. I'm open to doing it with a piece of the javascript api. This is for an edge case. I want to essentially have a fanbox as http://wiki.developers.facebook.com/index.php/Fan_Box:

<div id="facebook-fanbox" class="span-5 last">
    <script type="text/javascript" 
      src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"&gt;
    </script>

    <script type="text/javascript">
        FB.init("0fad4992394...f6fcde");
    </script>

    <fb:fan profile_id="16...42390" 
        stream="" connections="0" width="190" height="100">
    </fb:fan>

    <div style="...">
        <a href="http://www.facebook.com/apps/application.php?id=16...4239&gt;
            MyApp on Facebook
        </a> 
    </div>
</div>

Or with an iframe, this sort of thing:

<iframe id="facebook-fanbox-iframe" 
    scrolling="no" frameborder="0" 
    src="http://www.facebook.com/connect/connect.php?id=13...9&amp;connections=0&amp;stream=0" 
    allowtransparency="true" >
</iframe>

If I have connections > 0 then I can get the number but I get the avatars too which I don't want. There must be some easy way that I'm not thinking of to get the number of fans from the api or by scraping without getting the friends avatar. Even if I could find a place to get a callback from the JS loading process so I could just .hide(). Any suggestions?

+3  A: 

You can do an FQL query to get fan_count of a page.

Page FQL table

Bemmu