raicebook 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/raicebook.rb +3 -1
- data/lib/raicebook/base.rb +14 -0
- data/lib/raicebook/fb_events.rb +28 -0
- data/lib/raicebook/helpers.rb +22 -0
- data/lib/raicebook/version.rb +1 -1
- data/raicebook.gemspec +2 -0
- metadata +31 -3
data/lib/raicebook.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'raicebook'
|
2
|
+
require 'raicebook/base'
|
3
|
+
|
4
|
+
module Raicebook
|
5
|
+
class FbEvents < Base
|
6
|
+
|
7
|
+
# You can give an app_id or the current logged user "me" example : FbEvent.all(:id => "me"),
|
8
|
+
# if you would like the events from the current user you must give an active access token
|
9
|
+
# The default value of app_id is your application_id and for token it is the app token
|
10
|
+
# To use this in your app:
|
11
|
+
# include Raicebook
|
12
|
+
# and then in index action for example:
|
13
|
+
# @events = FbEvents.all
|
14
|
+
# so in the view you can do a each loop on the events
|
15
|
+
def self.all(options={})
|
16
|
+
# default value for facebook app
|
17
|
+
default_options = {
|
18
|
+
:id => Facebook::APP_ID,
|
19
|
+
:token => get_app_acc_token
|
20
|
+
}
|
21
|
+
options = default_options.merge(options)
|
22
|
+
|
23
|
+
graph = Koala::Facebook::GraphAPI.new(options[:token])
|
24
|
+
graph.get_connections(options[:id], "feed")
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/raicebook/helpers.rb
CHANGED
@@ -73,5 +73,27 @@ module Raicebook
|
|
73
73
|
content_tag("fb:like-box", "", options)
|
74
74
|
end
|
75
75
|
|
76
|
+
def fb_comments(options={})
|
77
|
+
default_options = {
|
78
|
+
:num_pots => "10",
|
79
|
+
:wdith => "425",
|
80
|
+
:publish_feed => "true"
|
81
|
+
}
|
82
|
+
options = default_options.merge(options)
|
83
|
+
|
84
|
+
content_tag("fb:comments", "", options)
|
85
|
+
end
|
86
|
+
|
87
|
+
def fb_login_button(options={})
|
88
|
+
default_options = {
|
89
|
+
:width => "200",
|
90
|
+
:show_faces => "true",
|
91
|
+
:max_rows => "1"
|
92
|
+
}
|
93
|
+
options = default_options.merge(options)
|
94
|
+
|
95
|
+
content_tag("fb:login-button", "", options)
|
96
|
+
end
|
97
|
+
|
76
98
|
end
|
77
99
|
end
|
data/lib/raicebook/version.rb
CHANGED
data/raicebook.gemspec
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bruno Wernimont
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-30 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -32,6 +32,32 @@ dependencies:
|
|
32
32
|
version: 3.0.3
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: koala
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: koala-rails
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
type: :runtime
|
60
|
+
version_requirements: *id003
|
35
61
|
description: This gem add a lot of usefull facebook helper for rails
|
36
62
|
email:
|
37
63
|
- hello@brunowernimont.be
|
@@ -46,6 +72,8 @@ files:
|
|
46
72
|
- Gemfile
|
47
73
|
- Rakefile
|
48
74
|
- lib/raicebook.rb
|
75
|
+
- lib/raicebook/base.rb
|
76
|
+
- lib/raicebook/fb_events.rb
|
49
77
|
- lib/raicebook/helpers.rb
|
50
78
|
- lib/raicebook/version.rb
|
51
79
|
- raicebook.gemspec
|