Checking Facebook Status Using Ruby -


i wanted check facebook status of page ruby script. first of possible. have been doing following:

  1. i got developer account
  2. i got app key , secret
  3. i installed json_pure gem

here code:

require 'rubygems'      require 'json/pure'      require 'net/http'      url ="https://graph.facebook.com/user_id/feed?access_token=app_id|app_secret"     uri = uri.parse(uri.encode(url.strip))       #to remove specia codes encode     #to remoce whitespace strip      req = net::http::get.new(uri.to_s)     res = net::http.start(uri.host, uri.port) {|http|       http.request(req)     }     html = res.body     res = json.parse(html) 

here error:

c:/ruby187/lib/ruby/1.8/net/protocol.rb:135:in `sysread': existing connection  forcibly closed remote host. (errno::econnreset) 

i recommend using koala gem instead of net::http

@graph = koala::facebook::api.new(oauth_access_token) status = @graph.get_connections("me", user_id, "status") 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -