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

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