Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more fb

  • Loading branch information...
commit 9b85fdaf1a0e1e74559f84c29ee39438c6d4d20f 1 parent 88a1a9b
@rogerbraun authored
View
3  Gemfile
@@ -5,3 +5,6 @@ gem "dm-core"
gem "dm-postgres-adapter"
gem "sinbook"
gem "datamapper"
+gem "rack-flash"
+gem "sinatra-authentication"
+
View
17 app.rb
@@ -25,7 +25,20 @@
end
get "/facebook" do
- fb.require_login!
- "Hi <fb:name uid=#{fb[:user]} useyou=false />!"
+ haml :facebook
+end
+
+get '/' do
+ haml :main
+end
+
+get '/receiver' do
+ %[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <body>
+ <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>
+ </body>
+ </html>]
end
View
10 views/facebook.haml
@@ -0,0 +1,10 @@
+- if fb[:user]
+ Hi,
+ %fb:profile-pic{:uid => fb[:user]}
+ %fb:name{:uid => fb[:user], :useyou => 'false', :firstnameonly => 'true'}
+ !
+ %br/
+ Do you want to <a href="javascript:FB.Connect.logoutAndRedirect('/')">logout</a>?
+- else
+ Please login:
+ %fb:login-button{:onlogin => 'document.location.reloa
View
1  views/index.haml
@@ -1,3 +1,4 @@
%p Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+%p="You can <fb:login-button></fb:login-button>."
%p Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
%p Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
View
2  views/layout.haml
@@ -18,6 +18,8 @@
<!--[if lt IE 7]><link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="screen"><![endif]-->
</head>
<body>
+:javascript
+ FB.init("#{fb.api_key}","/receiver")
<div id="wrap">
<header>
<div class="inside">
Please sign in to comment.
Something went wrong with that request. Please try again.