facebooker 1.0.42 → 1.0.43
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/facebooker.gemspec +1 -1
- data/lib/facebooker/parser.rb +1 -0
- data/lib/facebooker/session.rb +21 -8
- data/lib/facebooker/version.rb +1 -1
- metadata +1 -1
data/facebooker.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{facebooker}
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.43"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Chad Fowler", "Patrick Ewing", "Mike Mangino", "Shane Vitarana", "Corey Innis"]
|
data/lib/facebooker/parser.rb
CHANGED
@@ -565,6 +565,7 @@ module Facebooker
|
|
565
565
|
103 => Facebooker::Session::CallOutOfOrder,
|
566
566
|
104 => Facebooker::Session::IncorrectSignature,
|
567
567
|
120 => Facebooker::Session::InvalidAlbumId,
|
568
|
+
200 => Facebooker::Session::PermissionError,
|
568
569
|
250 => Facebooker::Session::ExtendedPermissionRequired,
|
569
570
|
321 => Facebooker::Session::AlbumIsFull,
|
570
571
|
324 => Facebooker::Session::MissingOrInvalidImageFile,
|
data/lib/facebooker/session.rb
CHANGED
@@ -50,6 +50,7 @@ module Facebooker
|
|
50
50
|
class FQLStatementNotIndexable < StandardError; end
|
51
51
|
class FQLFunctionDoesNotExist < StandardError; end
|
52
52
|
class FQLWrongNumberArgumentsPassedToFunction < StandardError; end
|
53
|
+
class PermissionError < StandardError; end
|
53
54
|
class InvalidAlbumId < StandardError; end
|
54
55
|
class AlbumIsFull < StandardError; end
|
55
56
|
class MissingOrInvalidImageFile < StandardError; end
|
@@ -394,14 +395,22 @@ module Facebooker
|
|
394
395
|
# Register a template bundle with Facebook.
|
395
396
|
# returns the template id to use to send using this template
|
396
397
|
def register_template_bundle(one_line_story_templates,short_story_templates=nil,full_story_template=nil, action_links=nil)
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
398
|
+
templates = ensure_array(one_line_story_templates)
|
399
|
+
parameters = {:one_line_story_templates => templates.to_json}
|
400
|
+
|
401
|
+
unless action_links.blank?
|
402
|
+
parameters[:action_links] = action_links.to_json
|
403
|
+
end
|
404
|
+
|
405
|
+
unless short_story_templates.blank?
|
406
|
+
templates = ensure_array(short_story_templates)
|
407
|
+
parameters[:short_story_templates] = templates.to_json
|
408
|
+
end
|
409
|
+
|
410
|
+
unless full_story_template.blank?
|
411
|
+
parameters[:full_story_template] = full_story_template.to_json
|
412
|
+
end
|
413
|
+
|
405
414
|
post("facebook.feed.registerTemplateBundle", parameters, false)
|
406
415
|
end
|
407
416
|
|
@@ -628,6 +637,10 @@ module Facebooker
|
|
628
637
|
end.sort.join
|
629
638
|
Digest::MD5.hexdigest([raw_string, secret_for_method(params[:method])].join)
|
630
639
|
end
|
640
|
+
|
641
|
+
def ensure_array(value)
|
642
|
+
value.is_a?(Array) ? value : [value]
|
643
|
+
end
|
631
644
|
end
|
632
645
|
|
633
646
|
class CanvasSession < Session
|
data/lib/facebooker/version.rb
CHANGED