facebooker 1.0.66 → 1.0.67
Sign up to get free protection for your applications and to get access to all the features.
- data/facebooker.gemspec +2 -2
- data/lib/facebooker/parser.rb +6 -1
- data/lib/facebooker/rails/helpers/fb_connect.rb +1 -0
- data/lib/facebooker/version.rb +1 -1
- data/test/facebooker_test.rb +61 -1
- metadata +2 -2
data/facebooker.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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.67"
|
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", "Mike Mangino"]
|
9
|
-
s.date = %q{2010-03-
|
9
|
+
s.date = %q{2010-03-30}
|
10
10
|
s.description = %q{Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]. Its goals are:
|
11
11
|
|
12
12
|
* Idiomatic Ruby
|
data/lib/facebooker/parser.rb
CHANGED
@@ -84,7 +84,12 @@ module Facebooker
|
|
84
84
|
if element.children.size == 1 && element.children.first.text?
|
85
85
|
element.content.strip
|
86
86
|
else
|
87
|
-
|
87
|
+
# We can have lists in not list item
|
88
|
+
if element['list'] == 'true'
|
89
|
+
element.children.reject{|c| c.text? }.map { |subchild| hash_or_value_for(subchild)}
|
90
|
+
else
|
91
|
+
hashinate(element)
|
92
|
+
end
|
88
93
|
end
|
89
94
|
end
|
90
95
|
|
@@ -47,6 +47,7 @@ module Facebooker
|
|
47
47
|
#{case options[:js]
|
48
48
|
when :jquery then "jQuery(document).ready("
|
49
49
|
when :dojo then "dojo.addOnLoad("
|
50
|
+
when :mootools then "window.addEvent('domready',"
|
50
51
|
else "Element.observe(window,'load',"
|
51
52
|
end} function() {
|
52
53
|
FB_RequireFeatures(#{required_features.to_json}, function() {
|
data/lib/facebooker/version.rb
CHANGED
data/test/facebooker_test.rb
CHANGED
@@ -418,7 +418,14 @@ class TestFacebooker < Test::Unit::TestCase
|
|
418
418
|
assert_equal false, @session.remove_comment('pete_comments',123)
|
419
419
|
end
|
420
420
|
|
421
|
-
|
421
|
+
# We can have lists in not list item, see ewample_with_list_in_none_list_item_xml : there is comment_list in comments node
|
422
|
+
def test_parser_with_list_item_in_not_list_item
|
423
|
+
expect_http_posts_with_responses(ewample_with_list_in_none_list_item_xml)
|
424
|
+
response = @session.fql_query('Lets be frank. We are not testing the query here')
|
425
|
+
assert_equal 3, response.first["comments"]['comment_list'].size
|
426
|
+
assert_equal "ahahhahaha\n i don't know the original one, but this is awesome (without waiting for it)", response.first["comments"]['comment_list'].first['text']
|
427
|
+
end
|
428
|
+
|
422
429
|
|
423
430
|
private
|
424
431
|
def populate_user_info
|
@@ -1200,4 +1207,57 @@ class TestFacebooker < Test::Unit::TestCase
|
|
1200
1207
|
"0"
|
1201
1208
|
end
|
1202
1209
|
|
1210
|
+
def ewample_with_list_in_none_list_item_xml
|
1211
|
+
<<-XML
|
1212
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
1213
|
+
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true">
|
1214
|
+
<stream_post>
|
1215
|
+
<post_id>12345678_901234</post_id>
|
1216
|
+
<actor_id>12345</actor_id>
|
1217
|
+
<comments>
|
1218
|
+
<can_remove>1</can_remove>
|
1219
|
+
<can_post>1</can_post>
|
1220
|
+
<count>3</count>
|
1221
|
+
<comment_list list="true">
|
1222
|
+
<comment>
|
1223
|
+
<fromid>6667785</fromid>
|
1224
|
+
<time>2223332</time>
|
1225
|
+
<text>ahahhahaha
|
1226
|
+
i don't know the original one, but this is awesome (without waiting for it)</text>
|
1227
|
+
<id>12345678_901234_23456</id>
|
1228
|
+
</comment>
|
1229
|
+
<comment>
|
1230
|
+
<fromid>6667785</fromid>
|
1231
|
+
<time>1268732285</time>
|
1232
|
+
<text>héhé :)
|
1233
|
+
Have you listen their Mickeal Jackson's cover ?</text>
|
1234
|
+
<id>785637999_368045444730_12404854</id>
|
1235
|
+
</comment>
|
1236
|
+
<comment>
|
1237
|
+
<fromid>1345267</fromid>
|
1238
|
+
<time>1268733276</time>
|
1239
|
+
<text>not yet!
|
1240
|
+
unfortunately i'm at work so i can't go through all of them..
|
1241
|
+
but yes, i saw it
|
1242
|
+
brilliant!</text>
|
1243
|
+
<id>12345678_901234_234567</id>
|
1244
|
+
</comment>
|
1245
|
+
</comment_list>
|
1246
|
+
</comments>
|
1247
|
+
<likes>
|
1248
|
+
<href>http://www.facebook.com/social_graph.php?node_id=23546&class=LikeManager</href>
|
1249
|
+
<count>1</count>
|
1250
|
+
<sample list="true"/>
|
1251
|
+
<friends list="true">
|
1252
|
+
<uid>234567</uid>
|
1253
|
+
</friends>
|
1254
|
+
<user_likes>0</user_likes>
|
1255
|
+
<can_like>1</can_like>
|
1256
|
+
</likes>
|
1257
|
+
</stream_post>
|
1258
|
+
</fql_query_response>
|
1259
|
+
XML
|
1260
|
+
end
|
1261
|
+
|
1262
|
+
|
1203
1263
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebooker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fowler
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-30 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|