From 268096fc233652a2f8cee13173779cf03c201c57 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2011 09:04:33 -0500 Subject: [PATCH 1/7] added README and some Heroku instructions --- README | 22 ++++++++++++++++++++++ faceboku.rb | 5 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..733ee26 --- /dev/null +++ b/README @@ -0,0 +1,22 @@ +This is forked from a Sinatra app which shows how to do Facebook Login/Logout, as well as Like & Share buttons. + +To use this application, you first need to go to Facebook and get application credentials. + +http://www.facebook.com/developers/createapp.php + +You need your: + application ID: + application secret: + +You need to set up Ruby 1.9.2, and the heroku gem +> gem install heroku + +To deploy this application at heroku.com, you need to do the following: + +1. git clone https:// +2. cd jgodseFaceboku +3. heroku create --stack bamboo-mri-1.9.2 +4. git push heroku master +5. heroku config:add FB_APPLICATION_ID= FB_APPLICATION_SECRET= +6. heroku restart +7. heroku open \ No newline at end of file diff --git a/faceboku.rb b/faceboku.rb index 45f244f..d244688 100644 --- a/faceboku.rb +++ b/faceboku.rb @@ -3,8 +3,8 @@ enable :sessions -APP_ID = "153304591365687" -APP_SECRET = "7a7663099ccb62f180d985ba1252a3e2" +APP_ID = ENV['FB_APPLICATION_ID'] +APP_SECRET = ENV['FB_APPLICATION_SECRET'] use OmniAuth::Builder do provider :facebook, APP_ID, APP_SECRET, { :scope => 'email, status_update, publish_stream' } @@ -15,6 +15,7 @@ @articles << {:title => 'Introduction to Heroku', :url => 'http://docs.heroku.com/heroku'} @articles << {:title => 'Deploying Rack-based apps in Heroku', :url => 'http://docs.heroku.com/rack'} @articles << {:title => 'Learn Ruby in twenty minutes', :url => 'http://www.ruby-lang.org/en/documentation/quickstart/'} + @articles << {:title => 'Cloud Apps Experts Blog', :url => 'http://blog.cloud-apps-experts.com'} erb :index end From 69f4efa54ab235b9ef13451b6ab442101336c4ec Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2011 11:25:54 -0500 Subject: [PATCH 2/7] change instructions --- README | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README b/README index 733ee26..a79fb46 100644 --- a/README +++ b/README @@ -15,8 +15,7 @@ To deploy this application at heroku.com, you need to do the following: 1. git clone https:// 2. cd jgodseFaceboku -3. heroku create --stack bamboo-mri-1.9.2 +3. heroku create --stack bamboo-ree-1.8.7 4. git push heroku master 5. heroku config:add FB_APPLICATION_ID= FB_APPLICATION_SECRET= -6. heroku restart -7. heroku open \ No newline at end of file +6. heroku open From 6716c08e36b7b394c9fab977a7cc515df7a39aeb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2011 11:53:06 -0500 Subject: [PATCH 3/7] Changed faceboku to radiant-sky-944 --- README | 20 +++++++++++++++----- views/index.erb | 2 +- views/layout.erb | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README b/README index a79fb46..9026f5f 100644 --- a/README +++ b/README @@ -5,17 +5,27 @@ To use this application, you first need to go to Facebook and get application cr http://www.facebook.com/developers/createapp.php You need your: - application ID: - application secret: - -You need to set up Ruby 1.9.2, and the heroku gem + Facebook application ID: + Facebook application secret: + +Also, pick a "Application Name" for your app in the Facebook config page. + +You need to set up Ruby (I used 1.9.2) and the heroku gem > gem install heroku To deploy this application at heroku.com, you need to do the following: -1. git clone https:// +1. git clone https://jgodse@github.com/jgodse/jgodseFaceboku.git 2. cd jgodseFaceboku 3. heroku create --stack bamboo-ree-1.8.7 4. git push heroku master 5. heroku config:add FB_APPLICATION_ID= FB_APPLICATION_SECRET= 6. heroku open +7. Go to the application configuration page at Facebook and make sure that the "Site URL" and +"Canvas URL" is the same as the URL for this app. If you need to rename this app, use a +"heroku rename" on the app before reconfiguring Facebook. +8. At this point, reload the URL of your Facebook App and you should be able to login, logout, and hit the "like" and "share buttons. + + +* Note that this application does not work on the heroku stack bamboo-mri-1.9.2 +* Run "heroku stack" to ensure that it is bamboo-ree-1.8.7 \ No newline at end of file diff --git a/views/index.erb b/views/index.erb index 041decf..91b8b7d 100644 --- a/views/index.erb +++ b/views/index.erb @@ -24,5 +24,5 @@ <% if session['fb_auth'] %>

-

+

<% end %> \ No newline at end of file diff --git a/views/layout.erb b/views/layout.erb index f9f7648..75b6967 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -3,8 +3,8 @@ - - + + From 12c1194e34fd57674358a345ddfe25a624a78ddc Mon Sep 17 00:00:00 2001 From: Jay Godse Date: Mon, 21 Feb 2011 12:04:28 -0500 Subject: [PATCH 4/7] Change fb:admins to my facebook id --- views/layout.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/views/layout.erb b/views/layout.erb index 75b6967..9b97b1a 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -1,12 +1,12 @@ - - - - - - + + + + + + Faceboku