06 Dec 2009, 14:21
Generic-user-small

Adinda Praditya (10 posts)

Hi All,

I still confused how to use FQL described in the book (section 9.4). Since there’s no code provided for this chapter, i hope anyone can explain the following questions.

1. Where does this code should be put


@disciples = current_user.disciples
disciple_ids = @disciples.map(&:facebook_id).join(",")
users=current_user.facebook_session.fql_query(
  "select uid,hometown_location from user "+
    "where uid in (#{disciple_ids})")

2. And how the hometown method usage changed before using FQL?


def hometown(fb_user)
  fb_user ||= Facebooker::User.new(facebook_id)
  location = fb_user.hometown_location
  text_location =
    "#{location.city} #{location.state}" unless location.blank?
  text_location.blank? ? "an undisclosed location" : text_location
end

Thanks,
Adinda

07 Dec 2009, 02:29
Generic-user-small

Adinda Praditya (10 posts)

Nevermind, i got it now. Sorry, I shouldn’t have asked this.

Thanks!

07 Dec 2009, 14:12
Head_pragsmall

Mike Mangino (543 posts)

No problem! It’s definitely a tricky topic.

Mike

  You must be logged in to comment