raicebook 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/raicebook.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require 'raicebook'
2
+ require 'raicebook/base'
2
3
  require 'raicebook/helpers'
3
4
  require "action_controller"
5
+ require 'raicebook/fb_events'
4
6
 
5
7
  ActiveSupport.on_load(:action_view) do
6
8
  include Raicebook::Helpers
7
- end
9
+ end
@@ -0,0 +1,14 @@
1
+ require 'raicebook'
2
+ require 'koala'
3
+
4
+ module Raicebook
5
+ class Base
6
+
7
+ @protected
8
+
9
+ def self.get_app_acc_token
10
+ Koala::Facebook::OAuth.new.get_app_access_token
11
+ end
12
+
13
+ end
14
+ end
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Raicebook
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/raicebook.gemspec CHANGED
@@ -20,4 +20,6 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_dependency('rails', '~> 3.0.3')
23
+ s.add_dependency('koala')
24
+ s.add_dependency('koala-rails')
23
25
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
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-16 00:00:00 +01:00
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