public
Last active

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
before_filter :set_preload_fql
 
def set_preload_fql
preload_fql = Hash.new
preload_fql[:preload_user_permission] = {
:pattern => ".*",
:query => "SELECT publish_stream FROM permissions WHERE uid={*user*};"
}
preload_fql[:preload_friends] = {
:pattern => ".*",
:query => "SELECT uid2 FROM friend WHERE uid1={*user*};"
}
 
preload_fql[:preload_friend_ids_and_names] = {
:pattern => ".*",
:query => "SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={*user*});"
}
 
preload_fql[:preload_friend_name] = {
:pattern => ".*",
:query => "SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={*user*});"
}
preload_fql[:preload_male_friend_name] = {
:pattern => ".*",
:query => "SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={*user*}) AND sex='male';"
}
preload_fql[:preload_female_friend_name] = {
:pattern => ".*",
:query => "SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={*user*}) AND sex='female';"
}
 
Facebooker::Admin.new(Facebooker::Session.create).set_app_properties({:preload_fql => preload_fql.to_json})
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.