百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

facebooker2

> 编程语言
开源

一个简单的 Facebook 连接库,适用于 Ruby

312 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个简单的 Facebook 连接库,适用于 Ruby

Facebooker2

Provides rails helpers for interfacing with Facebook's OpenGraph Javascript API.

Requires the mogli and ruby-hmac gems.

Example

0- Prerequisite: You need a facebook app. Have your API Key, Application Secret, and Application ID handy.

1- Install facebooker2 as a plugin in your rails app.

2- Create config/facebooker.yml with the appropriate environment.

production:
  app_id: 
  secret: 
  api_key: 

3- Create config/initializers/facebooker2.rb and place the following line in it

Facebooker2.load_facebooker_yaml

4- Add the following line to your app/controllers/application_controller.rb (add it right after the line class `ApplicationController

  or 
  Welcome  false) %>!
  


  ', :scope => 'email,user_birthday') %>

Facebook canvas applications

If you are building an application that runs inside a Facebook canvas, all the coming requests from Facebook to your iframe will be POST requests.

You can use the PostCanvas rack middleware to turn the Facebook POST requests back to GET requests and keep your app restful as described in this blog post. If you are using Rails 3, put this line of code inside your config.ru file :

use Rack::PostCanvas

Also, if you plan on supporting IE 6/7 and use cookie authentication, you should add a P3P header to your response in order for IE to accept the cookie :

before_filter :set_p3p_header_for_third_party_cookies

See this blog post and this forum thread for details.

Contributing

Unit tests use rspec and require the following environment configuration to run: rails 2.3.10 rspec 1.3.1 rspec-rails 1.3.3 json 1.4.0

Invoke tests on Mac/Linux by running rake spec from this directory

Invoke tests on Windows by running spec spec/ from this directory

Copyright (c) 2010 Mike Mangino, released under the MIT license

Issues· 5 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言