title: Getting list of facebook page GEM koala
body: <p>I have a helper. Gets a list of the facebook fanpage. A few days ago to work, suddenly stopped. I stop after taking one fanpage. I get this error:</p>
  
  <pre><code>type: OAuthException, code: 100, message: (#100) Invalid Connection [HTTP 400]
  </code></pre>
  
  <p>This is my helper</p>
  
  <pre><code>  def self.download_fanpages(user_id)
  
  #API Facebook
  @graph = Koala::Facebook::API.new(Client.find(user_id).access_token.to_s) 
  
  #download list of fanpage
  for facebook_page in @graph.get_object("me/accounts/page")
    @graphs = Koala::Facebook::API.new(facebook_page["access_token"]) 
    @url = @graphs.get_object("me") 
    if @url['link'].index("facebook")    
      if !Fanpage.find_by_uid_and_user(facebook_page["id"],user_id)
        @fb = Fanpage.new
        @fb.user = user_id
      else
        @fb = Fanpage.find_by_uid(facebook_page["id"])
      end
      @fb.name = facebook_page["name"]
      @fb.access_token = facebook_page["access_token"]
      @fb.uid = facebook_page["id"]
      @fb.url = @url['link']
  
      #install or not install
      if @graphs.get_object("me/tabs/"+APP_ID.to_s).count &gt; 0
        @fb.install = 1
      else
        @fb.install = 0
      end
      @fb.save
    end
  end
  end
  </code></pre>
  
  <p>Does anyone else have a similar problem. How to solve it?</p>