How can I execute a FQL query with Facebook Graph API

Here’s an example of how to do a FQL query using the Graph API and JavaScript FB.api( { method: ‘fql.query’, query: ‘SELECT uid, first_name, last_name FROM user WHERE uid = ‘ + someUid }, function(data) { // do something with the response } ); This assumes you’ve already setup your page according to the Facebook … Read more

How to get large photo URL in one API call?

I haven’t tried this with stream/feed photos, but the generally accepted way of doing this is: http://graph.facebook.com/{ID of object}/picture If you want the “large” version, you would do: http://graph.facebook.com/{ID of object}/picture?type=large I’m not 100% sure if this would work for an actual photo (instead of a user profile picture or page profile pic), but I … Read more

Get Facebook “Like” count for every page on my domain

Actually I would do it this way: $arrayOfPages = array(‘url1’, ‘url2’, ‘url3’); $listOfPages = implode(‘,’, $arrayOfPages); SELECT share_count, like_count, comment_count, total_count, url FROM link_stat WHERE url IN ($listOfPages) That would give you all the data with the URL as a unique identifier without having to break Facebook’s policy against fake users. You can dynamically create … Read more

Getting the Facebook like/share count for a given URL

UPDATE: This solution is no longer valid. FQLs are deprecated since August 7th, 2016. https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22http://www.techlila.com%22 Also http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.techlila.com will show you all the data like ‘Share Count’, ‘Like Count’ and ‘Comment Count’ and total of all these. Change the URL (i.e. http://www.techlila.com) as per your need. This is the correct URL, I’m getting right results. EDIT … Read more

What’s the Facebook’s Graph API call limit?

The best answer to this question from another forum, from Ash Rust in 2010: “After some testing and discussion with the Facebook platform team, there is no official limit I’m aware of or can find in the documentation. However, I’ve found 600 calls per 600 seconds, per token & per IP to be about where … Read more

EOFError: end of file reached issue with Net::HTTP

If the URL is using https instead of http, you need to add the following line: parsed_url = URI.parse(url) http = Net::HTTP.new(parsed_url.host, parsed_url.port) http.use_ssl = true Note the additional http.use_ssl = true. And the more appropriate code which would handle both http and https will be similar to the following one. url = URI.parse(domain) req … Read more

File not found.