This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin = Facebooker::Session.new.admin | |
properties = admin.get_app_properties :preload_fql | |
preload_fql = JSON.parse(properties.preload_fql) || {} | |
if preload_fql['online_friends'].blank? | |
if preload_fql['friends'].blank? | |
preload_fql['friends'] = { | |
:pattern => '.*', | |
:query => "SELECT uid2 FROM friend WHERE uid1 = {*user*}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in the view | |
<% unless current_user.fan?(params[:fb_sig_app_id]) %> | |
<div style="width: 117px; height: 25px; margin-right: 10px; margin-bottom: 20px; float: right; overflow: hidden; position: relative;"> | |
<div style="position: absolute; top: -31px; left: -60px;"> | |
<fb:fan profile_id="<%= params[:fb_sig_app_id] %>" stream="1" connections="10" width="300"></fb:fan> | |
</div> | |
</div> | |
<% end %> | |
# in the model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/facebooker.rb | |
module Facebooker | |
class << self | |
def fetch_config_for(api_key) | |
if app = Application.find_by_api_key(api_key) | |
{ | |
'api_key' => app.api_key, | |
'secret_key' => app.secret, | |
'canvas_page_name' => app.canvas_name, | |
'callback_url' => app.callback_url, |
NewerOlder