Integrating Facebook Connect with your Rails Applications
取得連結
Facebook
X
Pinterest
以電子郵件傳送
其他應用程式
Facebook Connect is a set of APIs from Facebook that enable Facebook members to log onto third-party websites, applications, mobile devices and gaming systems with their Facebook identity. While logged in, users can connect with friends via these mediums and post information and updates to their Facebook profile. Developers can use these services to help their users connect and share with their Facebook friends on and off of Facebook and increase engagement for their website or application.
Originally unveiled during Facebook’s developer conference, F8, in July 2008, Facebook Connect became generally available in December 2008. According to an article from The New York Times, "Some say the services are representative of surprising new thinking in Silicon Valley. Instead of trying to hoard information about their users, the Internet companies (including Facebook, Google, MySpace and Twitter) all share at least some of that data so people do not have to enter the same identifying information again and again on different sites."
步驟1. Add the Developer Application.
步驟2. Create a New Facebook Application.
步驟3. Update the Facebook Application settings to point to your publicly available host.
Example settings(假設域名是:http://www.example.com):
Authentication Tab:
Enter Post-Authorize Callback URL, e.g. http://www.example.com/fb/post_authorize
Canvas Tab:
Enter Canvas Page URL, e.g. run_example_com
Enter Canvas Callback URL, e.g. http://www.example.com/fb/connect
Connect Tab:
Enter Connect URL, http://www.example.com/fb/connect
Advanced Tab:
Set Application Type as Web.
Set api_key, secret_key, canvas_page_name (copy the last part of the Canvas Page URL from the Canvas tab), callback_url (that's Canvas Callback URL from FB settings), and set set_asset_host_to_callback_url to false.
下面是一個facebooker.yml範例內容:
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
典型的方式是使用網站資料庫裡現有的Users資料表中的DB Record來和Facebook帳戶整合, 我們將在users table中新增fb_uid(facebook uid)和email_hash(to contain a hashed version of the user's email address)欄位。
A typical case for integration is to add Facebook Connect as an alternative way of authenticating for existing users. To achieve this, add fields fb_uid (facebook uid) and email_hash (to contain a hashed version of the user's email address) to the users table.
接下來新增一個Run Publisher模型: $ script/generate model RunPublisher
Publishing is handled by the RunPublisher class in app/models/run_publisher.rb. Every feed template needs to be registered with Facebook before it can be used and this is done via migrations.
編輯/app/models/run_publisher.rb的內容:
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Tutorial for restful_authentication on Rails with Facebook Connect in 15 minutes
http://www.madebymany.co.uk/tutorial-for-restful_authentication-on-rails-with-facebook-connect-in-15-minutes-00523
Tutorial on developing a Facebook platform application with Ruby On Rails
http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails
Integrating Facebook Connect with Rails Applications
http://nws.applicake.com/blog/index.php/2009/07/02/integrating-facebook-connect-with-rails-applications/
Using Facebooker to make a Rails site with Facebook Connect (Part 1)
http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-1/
Using Facebooker to make a Rails site with Facebook Connect (Part 2)
http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-2/
Using Facebooker to make a Rails site with Facebook Connect (Part 3)
http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-3/
Rails app on Facebook Connect
http://www.rubyflow.com/items/1322
Star in a Porno with Facebook Connect and Rails
http://spongetech.wordpress.com/2008/11/17/star-in-a-porno-with-facebook-connect-and-rails/
How to Facebook-Connect a Rails app
http://passthehash.com/hash/2009/05/how-to-facebook-connect-your-rails-app.html
Getting Started with Facebooker
http://www.pathf.com/blogs/2008/07/getting-started-with-facebooker/
週末林口在下毛毛雨,查了天氣預報新竹天氣還不錯,下午決定跑一趟尖石鄉,去走一趟 煤源山、比麟山、尖石山 連走,這個健行路線,有人稱之為 煤比尖連走 (也被稱為 凌尖縱走 ),個人走完全程來回大約三個半小時(建議抓五個小時)。 從凌空廊道起登,由越嶺稜線路,經煤源山、比麟山到尖石山原路往返。這條路線一路都走在森林中,因為有登山隊整理過山徑,路跡還算是清晰。全程海拔高度的起伏不大,陡上下的路段大概就幾十公尺的高度落差,大部分路段都是平緩的原始山徑,是相對輕鬆,且林相優美的中級山路線。 今天下午才從登山口起登,全程途中都沒碰到半個人,只有在比麟山往尖石山中間地點,碰見一群團體正要下山,後來我登頂下山後,又在煤源山附近再次碰到他們。 下山後,我在路旁看見一家由紅磚矮房建造的原住民料理餐廳,決定先吃個晚餐,因為已經肚子餓了,進門前也忘了查詢評價如何,不過出乎預料之外的美味,下次若有機會來這附近爬山,會考慮再來這裡用餐。 It was drizzling lightly in Linkou over the weekend. I checked the weather forecast, and it looked good in Hsinchu, so in the afternoon, I decided to take a trip to Jianshi Township to hike the route connecting Meiyuan Mountain, Biling Mountain, and Jianshi Mountain. Some call this the Meibi-Jian traverse, while others refer to it as the Lingjian traverse. I personally completed the whole route in about three and a half hours (but it's recommended to allow five hours). The hike starts from the Lingkong Corridor, following the ridgeline trail, passing Meiyuan Mountain, Biling Mou...
高遶溪古圳步道 位於桃園市復興區長興里,是羅馬公路途中,一個散步的好去處,它也是一條結合自然生態與文化歷史的步道。 去年有來走過一次 ,當時還沒有第二期步道,慢慢走大約半小時就到終點了,距離太短有點無趣。不過步道的第二期步道工程已於2025年完工,現在步道全長2.6公里,沿著高遶溪而建,早期為泰雅族人的狩獵古道,現在修繕後供遊客休閒使用,來走一趟步道,可以體驗當地的自然風光與人文特色。 高遶溪古圳步道的起點在天空咖啡旁(有消費的話可以停車,不過再往前走一點也有停車處),這條步道沿途景色優美,可以欣賞溪流、竹林等自然景觀,春天也能看到一些櫻花,還能享受愜意的森林浴。沿途設有兩座跨河繩橋,長度分別有21公尺和29公尺,增添了步道的趣味性和挑戰性。 這條步道屬於休閒等級,適合全家大小共同前往,單程約3公里左右,慢慢走大需50分鐘即可抵達高遶天空吊橋,小休息後再原路折返。這裡氣候很舒服,因為有茂密的竹林遮蔭,所以即使在夏天來,也不會覺得太熱。走在這樣的步道上,可以放鬆心情,享受大自然的寧靜。 總而言之,高遶溪古圳步道是一處結合自然美景與文化歷史的景點,適合喜愛親近自然的遊客前往探索,如果有行經羅馬公路,不妨順道造訪。 Located in Changxing Village, Fuxing District, Taoyuan City, the Gaorao Creek Ancient Canal Trail is a perfect spot for a leisurely stroll along the Roman Highway. It’s a trail that blends natural ecology with cultural history. I visited it once last year, when the second phase of the trail wasn’t yet completed. Back then, it took only about half an hour to reach the end at a slow pace, which felt a bit too short and uneventful. However, the second phase of the trail was finish...