Search code examples
facebook-graph-apicommentsfacebook-comments

Get comment count on posts across site


I have a site with lots of pages of content and a Facebook comment box (social plugin) on each one. Say, http://subdomain.site.org

I want to build a widget that searches that subdomain for the pages with the most comments on them and list them. Is there a way to do this?

Thanks!


Solution

  • its pretty easy to get the count of comments for each url

    use fql:

    SELECT url, comment_count, FROM link_stat WHERE url = " http://subdomain.site.org"
    

    you can also get the comment count on all the urls at the same time (depending on how many urls)

    SELECT url, comment_count,  FROM link_stat WHERE url in ("url1", "url2", "url3" ... )
    

    from facebook -FQL can handle simple math, basic boolean operators, AND or NOT logical operators, and ORDER BY and LIMIT clauses.

    fql does not support CONTAINS() or anything else like that to use for searching all url's from a subdomain.

    see here for the link_stat table - you can only query on column's that are indexable