facebooker-lite 1.0.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/.autotest +15 -0
  2. data/CHANGELOG.rdoc +24 -0
  3. data/COPYING.rdoc +19 -0
  4. data/Manifest.txt +114 -0
  5. data/README.rdoc +120 -0
  6. data/Rakefile +94 -0
  7. data/TODO.rdoc +4 -0
  8. data/facebooker.gemspec +42 -0
  9. data/generators/xd_receiver/templates/xd_receiver.html +10 -0
  10. data/generators/xd_receiver/templates/xd_receiver_ssl.html +10 -0
  11. data/generators/xd_receiver/xd_receiver_generator.rb +10 -0
  12. data/init.rb +25 -0
  13. data/install.rb +12 -0
  14. data/lib/facebooker.rb +261 -0
  15. data/lib/facebooker/adapters/adapter_base.rb +91 -0
  16. data/lib/facebooker/adapters/bebo_adapter.rb +77 -0
  17. data/lib/facebooker/adapters/facebook_adapter.rb +60 -0
  18. data/lib/facebooker/admin.rb +42 -0
  19. data/lib/facebooker/application.rb +37 -0
  20. data/lib/facebooker/attachment.rb +51 -0
  21. data/lib/facebooker/batch_request.rb +45 -0
  22. data/lib/facebooker/data.rb +57 -0
  23. data/lib/facebooker/feed.rb +78 -0
  24. data/lib/facebooker/logging.rb +44 -0
  25. data/lib/facebooker/mobile.rb +20 -0
  26. data/lib/facebooker/mock/service.rb +50 -0
  27. data/lib/facebooker/mock/session.rb +18 -0
  28. data/lib/facebooker/model.rb +139 -0
  29. data/lib/facebooker/models/affiliation.rb +10 -0
  30. data/lib/facebooker/models/album.rb +11 -0
  31. data/lib/facebooker/models/applicationproperties.rb +39 -0
  32. data/lib/facebooker/models/applicationrestrictions.rb +10 -0
  33. data/lib/facebooker/models/comment.rb +9 -0
  34. data/lib/facebooker/models/cookie.rb +10 -0
  35. data/lib/facebooker/models/education_info.rb +11 -0
  36. data/lib/facebooker/models/event.rb +28 -0
  37. data/lib/facebooker/models/family_relative_info.rb +7 -0
  38. data/lib/facebooker/models/friend_list.rb +16 -0
  39. data/lib/facebooker/models/group.rb +36 -0
  40. data/lib/facebooker/models/info_item.rb +10 -0
  41. data/lib/facebooker/models/info_section.rb +10 -0
  42. data/lib/facebooker/models/location.rb +8 -0
  43. data/lib/facebooker/models/message_thread.rb +89 -0
  44. data/lib/facebooker/models/notifications.rb +17 -0
  45. data/lib/facebooker/models/page.rb +46 -0
  46. data/lib/facebooker/models/photo.rb +19 -0
  47. data/lib/facebooker/models/tag.rb +12 -0
  48. data/lib/facebooker/models/user.rb +751 -0
  49. data/lib/facebooker/models/video.rb +9 -0
  50. data/lib/facebooker/models/work_info.rb +10 -0
  51. data/lib/facebooker/parser.rb +970 -0
  52. data/lib/facebooker/rails/backwards_compatible_param_checks.rb +31 -0
  53. data/lib/facebooker/rails/controller.rb +353 -0
  54. data/lib/facebooker/rails/extensions/action_controller.rb +47 -0
  55. data/lib/facebooker/rails/extensions/rack_setup.rb +16 -0
  56. data/lib/facebooker/rails/extensions/routing.rb +15 -0
  57. data/lib/facebooker/rails/facebook_pretty_errors.rb +22 -0
  58. data/lib/facebooker/rails/facebook_request_fix.rb +28 -0
  59. data/lib/facebooker/rails/facebook_request_fix_2-3.rb +31 -0
  60. data/lib/facebooker/rails/facebook_session_handling.rb +68 -0
  61. data/lib/facebooker/rails/facebook_url_rewriting.rb +60 -0
  62. data/lib/facebooker/rails/helpers/fb_connect.rb +75 -0
  63. data/lib/facebooker/rails/integration_session.rb +38 -0
  64. data/lib/facebooker/rails/profile_publisher_extensions.rb +42 -0
  65. data/lib/facebooker/rails/publisher.rb +608 -0
  66. data/lib/facebooker/rails/routing.rb +49 -0
  67. data/lib/facebooker/rails/test_helpers.rb +68 -0
  68. data/lib/facebooker/rails/utilities.rb +22 -0
  69. data/lib/facebooker/server_cache.rb +24 -0
  70. data/lib/facebooker/service.rb +103 -0
  71. data/lib/facebooker/service/base_service.rb +19 -0
  72. data/lib/facebooker/service/curl_service.rb +44 -0
  73. data/lib/facebooker/service/net_http_service.rb +12 -0
  74. data/lib/facebooker/service/typhoeus_multi_service.rb +27 -0
  75. data/lib/facebooker/service/typhoeus_service.rb +17 -0
  76. data/lib/facebooker/session.rb +786 -0
  77. data/lib/facebooker/stream_post.rb +19 -0
  78. data/lib/facebooker/version.rb +9 -0
  79. data/lib/net/http_multipart_post.rb +123 -0
  80. data/lib/rack/facebook.rb +89 -0
  81. data/lib/rack/facebook_session.rb +21 -0
  82. data/lib/tasks/facebooker.rake +19 -0
  83. data/lib/tasks/facebooker.rb +2 -0
  84. data/lib/tasks/tunnel.rake +46 -0
  85. data/rails/init.rb +1 -0
  86. data/setup.rb +1585 -0
  87. data/templates/layout.erb +24 -0
  88. data/test/facebooker/adapters_test.rb +191 -0
  89. data/test/facebooker/admin_test.rb +102 -0
  90. data/test/facebooker/application_test.rb +110 -0
  91. data/test/facebooker/attachment_test.rb +72 -0
  92. data/test/facebooker/batch_request_test.rb +83 -0
  93. data/test/facebooker/data_test.rb +86 -0
  94. data/test/facebooker/logging_test.rb +43 -0
  95. data/test/facebooker/mobile_test.rb +45 -0
  96. data/test/facebooker/model_test.rb +133 -0
  97. data/test/facebooker/models/event_test.rb +15 -0
  98. data/test/facebooker/models/page_test.rb +56 -0
  99. data/test/facebooker/models/photo_test.rb +16 -0
  100. data/test/facebooker/models/user_test.rb +1074 -0
  101. data/test/facebooker/rails/facebook_request_fix_2-3_test.rb +25 -0
  102. data/test/facebooker/rails/facebook_url_rewriting_test.rb +76 -0
  103. data/test/facebooker/rails/integration_session_test.rb +13 -0
  104. data/test/facebooker/rails/publisher_test.rb +538 -0
  105. data/test/facebooker/rails_integration_test.rb +1543 -0
  106. data/test/facebooker/server_cache_test.rb +44 -0
  107. data/test/facebooker/service_test.rb +58 -0
  108. data/test/facebooker/session_test.rb +883 -0
  109. data/test/facebooker_test.rb +1263 -0
  110. data/test/fixtures/multipart_post_body_with_only_parameters.txt +33 -0
  111. data/test/fixtures/multipart_post_body_with_single_file.txt +38 -0
  112. data/test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt +38 -0
  113. data/test/net/http_multipart_post_test.rb +52 -0
  114. data/test/rack/facebook_session_test.rb +34 -0
  115. data/test/rack/facebook_test.rb +73 -0
  116. data/test/rails_test_helper.rb +36 -0
  117. data/test/test_helper.rb +74 -0
  118. metadata +278 -0
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
+ require 'active_support'
3
+
4
+ class Facebooker::UserTest < Test::Unit::TestCase
5
+
6
+ def test_pid_should_be_treated_as_a_string
7
+ @photo = Facebooker::Photo.new(:pid=>"100000025509592_6801")
8
+ assert_equal("100000025509592_6801",@photo.pid)
9
+ end
10
+
11
+ def test_setting_id_should_also_use_new_method
12
+ @photo = Facebooker::Photo.new(:id=>"100000025509592_6801")
13
+ assert_equal("100000025509592_6801",@photo.id)
14
+ end
15
+
16
+ end
@@ -0,0 +1,1074 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
+ require 'active_support'
3
+
4
+ class Facebooker::UserTest < Test::Unit::TestCase
5
+
6
+ def setup
7
+ @session = Facebooker::Session.create('apikey', 'secretkey')
8
+ @user = Facebooker::User.new(1234, @session)
9
+ @other_user = Facebooker::User.new(4321, @session)
10
+ ENV['FACEBOOK_CANVAS_PATH'] ='facebook_app_name'
11
+ ENV['FACEBOOK_API_KEY'] = '1234567'
12
+ ENV['FACEBOOK_SECRET_KEY'] = '7654321'
13
+
14
+ @user.friends = [@other_user]
15
+ end
16
+
17
+ def test_has_permission
18
+ expect_http_posts_with_responses(has_app_permission_response_xml)
19
+ assert @user.has_permission?("status_update")
20
+ end
21
+
22
+ def test_has_permissions
23
+ expect_http_posts_with_responses(has_app_permission_response_xml, has_app_permission_response_xml)
24
+ assert @user.has_permissions?(["status_update", "read_stream"])
25
+ end
26
+
27
+ def test_app_user_should_return_false_if_facebook_returns_one
28
+ expect_http_posts_with_responses(is_app_user_true_response_xml)
29
+ assert @user.app_user?
30
+ end
31
+
32
+ def test_app_user_should_return_false_if_facebook_does_not_return_one
33
+ expect_http_posts_with_responses(is_app_user_false_response_xml)
34
+ assert !@user.app_user?
35
+ end
36
+
37
+ def test_can_ask_user_if_he_or_she_is_friends_with_another_user
38
+ assert(@user.friends_with?(@other_user))
39
+ end
40
+
41
+ def test_can_ask_user_if_he_or_she_is_friends_with_another_user_by_user_id
42
+ assert(@user.friends_with?(@other_user.id))
43
+ end
44
+
45
+ def test_does_not_query_facebook_for_uid
46
+ @session.expects(:post).never
47
+ assert_equal 1234, Facebooker::User.new(1234, @session).uid
48
+ end
49
+
50
+ def test_uid_is_always_an_integer
51
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").uid
52
+ assert_equal 1234, Facebooker::User.new(:id => "1234").uid
53
+
54
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").id
55
+ assert_equal 1234, Facebooker::User.new(:id => "1234").id
56
+
57
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").facebook_id
58
+ assert_equal 1234, Facebooker::User.new(:id => "1234").facebook_id
59
+ end
60
+
61
+ def test_cast_to_friend_list_id_with_nil
62
+ assert_nil @user.cast_to_friend_list_id(nil)
63
+ end
64
+ def test_cast_to_friend_list_id_with_integer
65
+ assert_equal 14,@user.cast_to_friend_list_id(14)
66
+ end
67
+ def test_cast_to_friend_list_id_with_string
68
+ @user.expects(:friend_lists).returns([Facebooker::FriendList.new(:flid=>199,:name=>"Work")])
69
+ assert_equal 199,@user.cast_to_friend_list_id("Work")
70
+ end
71
+ def test_cast_to_friend_list_id_with_friend_list
72
+ assert_equal 199,@user.cast_to_friend_list_id(Facebooker::FriendList.new(:flid=>199,:name=>"Work"))
73
+ end
74
+
75
+ def test_cast_to_friend_list_id_with_invalid_string_raises
76
+ @user.expects(:friend_lists).returns([Facebooker::FriendList.new(:flid=>1,:name=>"Not Picked")])
77
+ assert_nil @user.cast_to_friend_list_id("Something")
78
+ fail("No exception raised, Expected Facebooker::Session::InvalidFriendList")
79
+ rescue Facebooker::Session::InvalidFriendList
80
+ nil
81
+ end
82
+
83
+ def test_can_create_from_current_session
84
+ Facebooker::Session.expects(:current).returns("current")
85
+ user=Facebooker::User.new(1)
86
+ assert_equal("current",user.session)
87
+ end
88
+
89
+ def test_raises_when_no_session_bound
90
+ assert_raises(Facebooker::Model::UnboundSessionException) { Facebooker::User.new(1, nil).populate }
91
+ end
92
+
93
+ def test_passes_request_locale_when_set
94
+ session = mock()
95
+ session.expects(:post).with("facebook.users.getInfo",has_entry(:locale,"es_ES"))
96
+ Facebooker::Session.expects(:current).returns(session)
97
+ user=Facebooker::User.new(1)
98
+ user.request_locale="es_ES"
99
+ user.name
100
+
101
+ end
102
+
103
+ def test_doesnt_pass_request_locale_when_not_set
104
+ session = mock()
105
+ session.expects(:post).with("facebook.users.getInfo",Not(has_key(:locale)))
106
+ Facebooker::Session.expects(:current).returns(session)
107
+ user=Facebooker::User.new(1)
108
+ user.name
109
+
110
+ end
111
+
112
+ def test_can_set_mobile_fbml
113
+ @user.expects(:set_profile_fbml).with(nil,"test",nil,nil)
114
+ @user.mobile_fbml="test"
115
+ end
116
+ def test_can_set_profile_action
117
+ @user.expects(:set_profile_fbml).with(nil,nil,"test",nil)
118
+ @user.profile_action="test"
119
+ end
120
+ def test_can_set_profile_fbml
121
+ @user.expects(:set_profile_fbml).with("test",nil,nil,nil)
122
+ @user.profile_fbml="test"
123
+ end
124
+
125
+ def test_can_set_profile_main
126
+ @user.expects(:set_profile_fbml).with(nil,nil,nil,"test")
127
+ @user.profile_main="test"
128
+ end
129
+
130
+
131
+ def test_can_call_get_status
132
+ @session.expects(:post).with('facebook.status.get', {:uid => 1234, :limit => 4}).returns([{ "time" => 1233804858, "source" => 6628568379, "message" => "my message rocks!", "status_id" => 61436484312, 'uid' => 1234 }])
133
+ st = @user.statuses( 4 )
134
+ assert_equal st.size, 1
135
+ assert_equal st.first.message, 'my message rocks!'
136
+ end
137
+
138
+ def test_can_call_set_profile_fbml
139
+ @session.expects(:post).with('facebook.profile.setFBML', {:uid=>1234,:profile=>"profile",:profile_action=>"action",:mobile_profile=>"mobile"},false)
140
+ @user.set_profile_fbml("profile","mobile","action")
141
+ end
142
+
143
+ def test_can_call_set_profile_fbml_with_profile_main
144
+ @session.expects(:post).with('facebook.profile.setFBML', {:uid=>1234,:profile=>"profile",:profile_action=>"action",:mobile_profile=>"mobile", :profile_main => 'profile_main'},false)
145
+ @user.set_profile_fbml("profile","mobile","action",'profile_main')
146
+ end
147
+
148
+ def test_can_get_profile_photos
149
+ @user.expects(:profile_photos)
150
+ @user.profile_photos
151
+ end
152
+
153
+ def test_can_set_cookie
154
+ @user.expects(:set_cookie).with('name', 'value')
155
+ @user.set_cookie('name', 'value')
156
+ end
157
+
158
+ def test_can_get_cookies
159
+ @user.expects(:get_cookies).with('name')
160
+ @user.get_cookies('name')
161
+ end
162
+
163
+ def test_get_profile_photos
164
+ @user = Facebooker::User.new(548871286, @session)
165
+ expect_http_posts_with_responses(example_profile_photos_get_xml)
166
+ photos = @user.profile_photos
167
+ assert_equal "2357384227378429949", photos.first.aid
168
+ end
169
+
170
+ def test_prepare_publish_to_options_pass_only_neccessary_parameters
171
+ options = @user.prepare_publish_to_options(@user, {:message => 'Hey there', :action_links => [:text => 'Link', :href => 'http://example.com']})
172
+ assert_equal(options[:uid], @user.uid)
173
+ assert_equal(options[:target_id], @user.id)
174
+ assert_equal(options[:message], 'Hey there')
175
+ assert_nil(options[:attachment])
176
+ assert_equal(options[:action_links], [:text => 'Link', :href => 'http://example.com'].to_json )
177
+ end
178
+
179
+ def test_prepare_publish_to_options_to_page_on_behave_of_page
180
+ page_id = 12345678
181
+ options = @user.prepare_publish_to_options(@user, {:uid => 12345678, :post_as_page => true, :message => 'Hey there', :action_links => [:text => 'Link', :href => 'http://example.com']})
182
+ assert_equal(options[:uid], page_id)
183
+ assert_nil(options[:target_id])
184
+ assert_equal(options[:message], 'Hey there')
185
+ assert_nil(options[:attachment])
186
+ assert_equal(options[:action_links], [:text => 'Link', :href => 'http://example.com'].to_json )
187
+ end
188
+
189
+ def test_publish_to
190
+ @user = Facebooker::User.new(548871286, @session)
191
+ expect_http_posts_with_responses(example_profile_publish_to_get_xml)
192
+ @user.publish_to(@other_user, :message => 'i love you man')
193
+ end
194
+
195
+ def test_publish_to_converts_attachment_to_json
196
+ @user = Facebooker::User.new(548871286, @session)
197
+ @user.session.expects(:post).with("facebook.stream.publish",has_entry(:attachment=>instance_of(String)),false)
198
+ @user.publish_to(@other_user, :message => 'i love you man',:attachment=>{:a=>"b"})
199
+ end
200
+
201
+ def test_publish_to_converts_attachment_from_attachment_objecect
202
+ @user = Facebooker::User.new(548871286, @session)
203
+ @user.session.expects(:post).with("facebook.stream.publish",has_entry(:attachment=>instance_of(String)),false)
204
+ attachment = Facebooker::Attachment.new
205
+ attachment.name = "My name"
206
+ @user.publish_to(@other_user, :message => 'i love you man',:attachment=>attachment)
207
+ end
208
+
209
+ def test_comment_on
210
+ @user = Facebooker::User.new(548871286, @session)
211
+ expect_http_posts_with_responses(example_comment_on_response)
212
+ assert_equal('703826862_78463536863', @user.comment_on('703826862_78463536862', :message => 'that was hilarious!'))
213
+ end
214
+
215
+ def test_add_comment
216
+ @user = Facebooker::User.new(548871286, @session)
217
+ expect_http_posts_with_responses(example_add_comment_response)
218
+ assert_equal('403917', @user.add_comment('test_xid','that was realy hilarious!') )
219
+ end
220
+
221
+ def test_add_like_on
222
+ @user = Facebooker::User.new(548871286, @session)
223
+ expect_http_posts_with_responses(example_add_like_on_response)
224
+ assert_equal('1', @user.add_like_on('703826862_78463536862'))
225
+ end
226
+
227
+ def test_can_send_email
228
+ @user.expects(:send_email).with("subject", "body text")
229
+ @user.send_email("subject", "body text")
230
+
231
+ @user.expects(:send_email).with("subject", nil, "body fbml")
232
+ @user.send_email("subject", nil, "body fbml")
233
+ end
234
+
235
+ def test_doesnt_post_to_facebook_when_assigning_status
236
+ @session.expects(:post).never
237
+ @user.status="my status"
238
+ end
239
+ def test_can_set_status_with_string
240
+ @session.expects(:post).with('facebook.users.setStatus', {:status=>"my status",:status_includes_verb=>1, :uid => @user.uid}, false)
241
+ @user.set_status("my status")
242
+ end
243
+
244
+ def test_get_events
245
+ @user = Facebooker::User.new(9507801, @session)
246
+ expect_http_posts_with_responses(example_events_get_xml)
247
+ events = @user.events
248
+ assert_equal 29511517904, events.first.eid
249
+ end
250
+
251
+ def test_events_caching_honors_params
252
+ @user = Facebooker::User.new(9507801, @session)
253
+ @session.expects(:post).returns([{:eid=>1}])
254
+ assert_equal 1,@user.events.first.eid
255
+ @session.expects(:post).returns([{:eid=>2}])
256
+ assert_equal 2,@user.events(:start_time=>1.day.ago).first.eid
257
+ @session.expects(:post).never
258
+ assert_equal 1,@user.events.first.eid
259
+ end
260
+
261
+
262
+ def test_to_s
263
+ assert_equal("1234",@user.to_s)
264
+ end
265
+
266
+ def test_equality_with_same_id
267
+ assert_equal @user, @user.dup
268
+ assert_equal @user, Facebooker::User.new(:id => @user.id)
269
+ end
270
+
271
+ def test_not_equal_to_differnt_class
272
+ assert_not_equal @user, flexmock(:id => @user.id)
273
+ end
274
+
275
+ def test_hash_email
276
+ assert_equal "4228600737_c96da02bba97aedfd26136e980ae3761", Facebooker::User.hash_email("mary@example.com")
277
+ end
278
+ def test_hash_email_not_normalized
279
+ assert_equal "4228600737_c96da02bba97aedfd26136e980ae3761", Facebooker::User.hash_email(" MaRy@example.com ")
280
+ end
281
+
282
+ def test_register_with_array
283
+ expect_http_posts_with_responses(register_response_xml)
284
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.register([{:email=>"mary@example.com",:account_id=>1}])
285
+ end
286
+
287
+ def test_unregister_with_array
288
+ expect_http_posts_with_responses(unregister_response_xml)
289
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.unregister(["4228600737_c96da02bba97aedfd26136e980ae3761"])
290
+ end
291
+
292
+ def test_unregister_emails_with_array
293
+ expect_http_posts_with_responses(unregister_response_xml)
294
+ assert_equal ["mary@example.com"],Facebooker::User.unregister_emails(["mary@example.com"])
295
+ end
296
+
297
+ def test_register_with_array_raises_if_not_all_success
298
+ expect_http_posts_with_responses(register_response_xml)
299
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.register([{:email=>"mary@example.com",:account_id=>1},{:email=>"mike@example.com",:account_id=>2}])
300
+ fail "Should have raised Facebooker::Session::UserRegistrationFailed"
301
+ rescue Facebooker::Session::UserRegistrationFailed => e
302
+ assert_equal({:email=>"mike@example.com",:account_id=>2},e.failed_users.first)
303
+ end
304
+
305
+ def test_unregister_with_array_raises_if_not_all_success
306
+ expect_http_posts_with_responses(unregister_response_xml)
307
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.unregister(["4228600737_c96da02bba97aedfd26136e980ae3761","3587916587_791214eb452bf4de30e957d65a0234d4"])
308
+ fail "Should have raised Facebooker::Session::UserUnRegistrationFailed"
309
+ rescue Facebooker::Session::UserUnRegistrationFailed => e
310
+ assert_equal("3587916587_791214eb452bf4de30e957d65a0234d4",e.failed_users.first)
311
+ end
312
+
313
+ def test_unregister_emails_with_array_raises_if_not_all_success
314
+ expect_http_posts_with_responses(unregister_response_xml)
315
+ assert_equal ["mary@example.com"],Facebooker::User.unregister_emails(["mary@example.com","mike@example.com"])
316
+ fail "Should have raised Facebooker::Session::UserUnRegistrationFailed"
317
+ rescue Facebooker::Session::UserUnRegistrationFailed => e
318
+ assert_equal("mike@example.com",e.failed_users.first)
319
+ end
320
+
321
+
322
+ def test_get_locale
323
+ @user = Facebooker::User.new(9507801, @session)
324
+ expect_http_posts_with_responses(example_users_get_info_xml)
325
+ assert_equal "en_US", @user.locale
326
+ end
327
+
328
+ def test_get_profile_url
329
+ @user = Facebooker::User.new(8055, @session)
330
+ expect_http_posts_with_responses(example_users_get_info_xml)
331
+ assert_equal "http://www.facebook.com/profile.php?id=8055", @user.profile_url
332
+ end
333
+
334
+ def test_can_rsvp_to_event
335
+ expect_http_posts_with_responses(example_events_rsvp_xml)
336
+ result = @user.rsvp_event(1000, 'attending')
337
+ assert result
338
+ end
339
+
340
+ # Dashboard count APIs
341
+
342
+ def test_can_set_dashboard_count
343
+ @session.expects(:post).with('facebook.dashboard.setCount', {:uid => @user.uid, :count => 12})
344
+ @user.dashboard_count = 12
345
+ end
346
+
347
+ def test_parse_set_dashboard_count
348
+ expect_http_posts_with_responses(dashboard_set_count_xml)
349
+ assert_equal 12, @user.dashboard_count = 12
350
+ end
351
+
352
+ def test_can_increment_dashboard_count
353
+ @session.expects(:post).with('facebook.dashboard.incrementCount', {:uid => @user.uid})
354
+ @user.dashboard_increment_count
355
+ end
356
+
357
+ def test_parse_increment_dashboard_count
358
+ expect_http_posts_with_responses(dashboard_increment_count_xml)
359
+ assert_equal true, @user.dashboard_increment_count
360
+ end
361
+
362
+ def test_can_decrement_dashboard_count
363
+ @session.expects(:post).with('facebook.dashboard.decrementCount', {:uid => @user.uid})
364
+ @user.dashboard_decrement_count
365
+ end
366
+
367
+ def test_parse_decrement_dashboard_count
368
+ expect_http_posts_with_responses(dashboard_decrement_count_xml)
369
+ assert_equal true, @user.dashboard_decrement_count
370
+ end
371
+
372
+ def test_can_get_dashboard_count
373
+ @session.expects(:post).with('facebook.dashboard.getCount', {:uid => @user.uid}).returns(12)
374
+ @user.dashboard_count
375
+ end
376
+
377
+ def test_threads_should_return_an_array_of_thread_instances_containing_messages_and_attachments
378
+ expect_http_posts_with_responses(example_threads)
379
+ threads = @user.threads
380
+ assert_not_nil threads
381
+ assert_instance_of Array, threads
382
+ assert_operator threads.size, :>, 0
383
+ for thread in threads
384
+ assert_instance_of Facebooker::MessageThread, thread
385
+ assert_instance_of Array, thread.messages
386
+ assert_operator thread.messages.size, :>, 0
387
+ assert_instance_of Facebooker::MessageThread::Message, thread.messages.first
388
+
389
+ for message in thread.messages
390
+ next if message.attachment.blank?
391
+ assert_instance_of Facebooker::MessageThread::Message::Attachment, message.attachment
392
+
393
+ case message.message_id
394
+ when '1344434538976_0'
395
+ assert message.attachment.photo?, 'Attachment of message "1344434538976_0" should be a photo'
396
+ when '1344434538976_2'
397
+ assert message.attachment.link?, 'Attachment of message "1344434538976_2" should be a link'
398
+ when '1012985167472_0'
399
+ assert message.attachment.video?, 'Attachment of message "1012985167472_0" should be a video'
400
+ end
401
+ end
402
+ end
403
+ end
404
+
405
+ def test_threads_should_return_populated_fields
406
+ expect_http_posts_with_responses(example_threads)
407
+ threads = @user.threads
408
+
409
+ thread = threads.first
410
+ [:thread_id, :subject, :updated_time, :recipients, :parent_message_id, :parent_thread_id,
411
+ :message_count, :snippet, :snippet_author, :object_id, :unread].each do |field|
412
+ assert_not_nil thread.__send__(field), "Field #{field} should not be nil"
413
+ end
414
+ end
415
+
416
+ def test_parse_get_dashboard_count
417
+ expect_http_posts_with_responses(dashboard_get_count_xml)
418
+ assert_equal '12', @user.dashboard_count
419
+ end
420
+
421
+ def test_can_dashboard_multi_set_count
422
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiSetCount', :ids => { '1234' => '11', '5678' => '22' }.to_json)
423
+ Facebooker::User.dashboard_multi_set_count({ '1234' => '11', '5678' => '22' })
424
+ end
425
+
426
+ def test_parse_dashboard_multi_set_count
427
+ expect_http_posts_with_responses(dashboard_multi_set_count_xml)
428
+ assert_equal({ '1234' => true, '4321' => true }, Facebooker::User.dashboard_multi_set_count({ '1234' => '11', '5678' => '22' }))
429
+ end
430
+
431
+ def test_can_dashboard_multi_get_count
432
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiGetCount', :uids => ['1234', '4321'])
433
+ Facebooker::User.dashboard_multi_get_count ['1234', '4321']
434
+ end
435
+
436
+ def test_parse_dashboard_multi_get_count
437
+ expect_http_posts_with_responses(dashboard_multi_get_count_xml)
438
+ assert_equal({ '1234' => '11', '4321' => '22' }, Facebooker::User.dashboard_multi_get_count(['1234', '4321']))
439
+ end
440
+
441
+ def test_can_dashboard_multi_increment_count_with_single_uid
442
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiIncrementCount', :uids => ['8675309'].to_json)
443
+ Facebooker::User.dashboard_multi_increment_count 8675309
444
+ end
445
+
446
+ def test_can_dashboard_multi_increment_count_with_multiple_uids
447
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiIncrementCount', :uids => ['8675309', '555'].to_json)
448
+ Facebooker::User.dashboard_multi_increment_count 8675309, 555
449
+ end
450
+
451
+ def test_can_dashboard_multi_increment_count_with_array_of_uids
452
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiIncrementCount', :uids => ['1234', '4321'].to_json)
453
+ Facebooker::User.dashboard_multi_increment_count ['1234', '4321']
454
+ end
455
+
456
+ def test_parse_dashboard_multi_increment_count
457
+ expect_http_posts_with_responses(dashboard_multi_increment_count_xml)
458
+ assert_equal({ '1234' => true, '4321' => true }, Facebooker::User.dashboard_multi_increment_count(['1234', '4321']))
459
+ end
460
+
461
+ def test_can_dashboard_multi_decrement_count_with_single_uid
462
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiDecrementCount', :uids => ['99999999'].to_json)
463
+ Facebooker::User.dashboard_multi_decrement_count 99999999
464
+ end
465
+
466
+ def test_can_dashboard_multi_decrement_count_with_multiple_uids
467
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiDecrementCount', :uids => ['1111', '2222'].to_json)
468
+ Facebooker::User.dashboard_multi_decrement_count 1111, 2222
469
+ end
470
+
471
+ def test_parse_dashboard_multi_decrement_count_with_array_of_uids
472
+ expect_http_posts_with_responses(dashboard_multi_decrement_count_xml)
473
+ assert_equal({ '1234' => true, '4321' => true }, Facebooker::User.dashboard_multi_decrement_count(['1234', '4321']))
474
+ end
475
+ # Dashboard
476
+
477
+ def test_can_get_news
478
+ @session.expects(:post).with('facebook.dashboard.getNews', {:uid => @user.uid, :news_ids => ['123']})
479
+ @user.get_news ['123']
480
+ end
481
+
482
+ def test_can_get_news
483
+ @session.expects(:post).with('facebook.dashboard.getNews', {:uid => @user.uid, :news_ids => ['123']})
484
+ @user.get_news ['123']
485
+ end
486
+
487
+ def test_parse_get_news
488
+ expect_http_posts_with_responses(get_news_xml)
489
+ assert_equal({"304847042079"=>{"fbid"=>"304847042079", "time"=>"1266020260510", "news"=>[{"action_link"=>{"href"=>"http://facebook.er/", "text"=>"I... I'm a test user"}, "message"=>"Hey, who are you?"}, {"action_link"=>{"href"=>"http://facebook.er/", "text"=>"I'm sorry"}, "message"=>"Stop using my application, nerd"}], "image"=>"http://facebook.er/icon.png"}}, @user.get_news(['304847042079']))
490
+ end
491
+
492
+ def test_can_add_news
493
+ @session.expects(:post).with('facebook.dashboard.addNews', {:news => [{:message => 'Hi user', :action_link => {:text => 'Uh hey there app', :href => 'http://facebook.er/'}}], :uid => @user.uid, :image => 'http://facebook.er/icon.png'})
494
+ @user.add_news [{ :message => 'Hi user', :action_link => { :text => "Uh hey there app", :href => 'http://facebook.er/' }}], 'http://facebook.er/icon.png'
495
+ end
496
+
497
+ def test_parse_add_news
498
+ expect_http_posts_with_responses(add_news_xml)
499
+ assert_equal("316446838026", @user.add_news([{ :message => 'Hi user', :action_link => { :text => "Uh hey there app", :href => 'http://facebook.er/' }}], 'http://facebook.er/icon.png'))
500
+ end
501
+
502
+ def test_can_clear_news
503
+ @session.expects(:post).with('facebook.dashboard.clearNews', { :uid => @user.uid, :news_ids => ['123']})
504
+ @user.clear_news '123'
505
+ end
506
+
507
+ def test_parse_clear_news
508
+ expect_http_posts_with_responses(clear_news_xml)
509
+ assert_equal({"362466171040"=>true}, @user.clear_news('362466171040'))
510
+ end
511
+
512
+ def test_can_multi_add_news
513
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiAddNews', { :uids => ['1234', '4321'], :news => [{ :message => 'Hi user', :action_link => { :text => "Uh hey there app", :href => 'http://facebook.er/' }}], :image => 'http://facebook.er/icon.png'})
514
+ Facebooker::User.multi_add_news(['1234', '4321'], [{ :message => 'Hi user', :action_link => { :text => "Uh hey there app", :href => 'http://facebook.er/' }}], 'http://facebook.er/icon.png')
515
+ end
516
+
517
+ def test_parse_multi_add_news
518
+ expect_http_posts_with_responses(multi_add_news_xml)
519
+ assert_equal({"1234"=>"319103117527", "4321"=>"313954287803"}, Facebooker::User.multi_add_news(['1234', '4321'], [{ :message => 'Hi user', :action_link => { :text => "Uh hey there app", :href => 'http://facebook.er/' }}], 'http://facebook.er/icon.png'))
520
+ end
521
+
522
+ def test_can_multi_get_news
523
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiGetNews', { :ids => {"1234"=>["319103117527"], "4321"=>["313954287803"]}.to_json})
524
+ Facebooker::User.multi_get_news({"1234"=>["319103117527"], "4321"=>["313954287803"]})
525
+ end
526
+
527
+ def test_parse_multi_get_news
528
+ expect_http_posts_with_responses(multi_get_news_xml)
529
+ assert_equal({"1234"=>{"319103117527"=>{"fbid"=>"319103117527", "time"=>"1266605866056", "news"=>[{"action_link"=>{"href"=>"http://facebook.er/", "text"=>"Uh hey there app"}, "message"=>"Hi user"}], "image"=>"http://facebook.er/icon.png"}}, "4321"=>{"313954287803"=>{"fbid"=>"313954287803", "time"=>"1266605866123", "news"=>[{"action_link"=>{"href"=>"http://facebook.er/", "text"=>"Uh hey there app"}, "message"=>"Hi user"}], "image"=>"http://facebook.er/icon.png"}}}, Facebooker::User.multi_get_news({"1234"=>["319103117527"], "4321"=>["313954287803"]}))
530
+ end
531
+
532
+ def test_can_multi_clear_news
533
+ Facebooker::Session.any_instance.expects(:post).with('facebook.dashboard.multiClearNews', { :ids => {"1234"=>["319103117527"], "4321"=>["313954287803"]}.to_json})
534
+ Facebooker::User.multi_clear_news({"1234"=>["319103117527"], "4321"=>["313954287803"]})
535
+ end
536
+
537
+ def test_parse_multi_clear_news
538
+ expect_http_posts_with_responses(multi_clear_news_xml)
539
+ assert_equal({"1234"=>{"319103117527"=>true}, "4321"=>{"313954287803"=>true}}, Facebooker::User.multi_clear_news({"1234"=>["319103117527"], "4321"=>["313954287803"]}))
540
+ end
541
+
542
+ def test_can_publish_activity
543
+ @session.expects(:post).with('facebook.dashboard.publishActivity', { :activity => { :message => '{*actor*} rolled around', :action_link => { :text => 'Roll around too', :href => 'http://facebook.er/' }}.to_json})
544
+ @user.publish_activity({ :message => '{*actor*} rolled around', :action_link => { :text => 'Roll around too', :href => 'http://facebook.er/' }})
545
+ end
546
+
547
+ def test_parse_publish_activity
548
+ expect_http_posts_with_responses(publish_activity_xml)
549
+ assert_equal('484161135393', @user.publish_activity({ :message => '{*actor*} rolled around', :action_link => { :text => 'Roll around too', :href => 'http://facebook.er/' }}))
550
+ end
551
+
552
+ def test_can_get_activity
553
+ @session.expects(:post).with('facebook.dashboard.getActivity', { :activity_ids => ['123'] })
554
+ @user.get_activity '123'
555
+ end
556
+
557
+ def test_parse_get_activity
558
+ expect_http_posts_with_responses(get_activity_xml)
559
+ assert_equal({"342454152268"=>{"fbid"=>"342454152268", "time"=>"1266607632567", "action_link"=>{"href"=>"http://facebook.er/", "text"=>"Roll around too"}, "message"=>"{*actor*} rolled around"}}, @user.get_activity('342454152268'))
560
+ end
561
+
562
+ def test_can_remove_activity
563
+ @session.expects(:post).with('facebook.dashboard.removeActivity', { :activity_ids => ['123'] })
564
+ @user.remove_activity ['123']
565
+ end
566
+
567
+ def test_parse_remove_activity
568
+ expect_http_posts_with_responses(remove_activity_xml)
569
+ assert_equal({"342454152268"=>true}, @user.remove_activity('123'))
570
+ end
571
+
572
+
573
+ private
574
+ def example_profile_photos_get_xml
575
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
576
+ <photos_get_response xmlns=\"http://api.facebook.com/1.0/\"
577
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
578
+ xsi:schemaLocation=\"http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd\" list=\"true\">
579
+ <photo>
580
+ <pid>34585991612804</pid>
581
+ <aid>2357384227378429949</aid>
582
+ <owner>1240077</owner>
583
+ <src>http://ip002.facebook.com/v11/135/18/8055/s1240077_30043524_2020.jpg</src>
584
+ <src_big>http://ip002.facebook.com/v11/135/18/8055/n1240077_30043524_2020.jpg</src_big>
585
+ <src_small>http://ip002.facebook.com/v11/135/18/8055/t1240077_30043524_2020.jpg</src_small>
586
+ <link>http://www.facebook.com/photo.php?pid=30043524&amp;id=8055</link>
587
+ <caption>From The Deathmatch (Trailer) (1999)</caption>
588
+ <created>1132553361</created>
589
+ </photo>
590
+ <photo>
591
+ <pid>34585991612805</pid>
592
+ <aid>2357384227378429949</aid>
593
+ <owner>1240077</owner>
594
+ <src>http://ip002.facebook.com/v11/135/18/8055/s1240077_30043525_2184.jpg</src>
595
+ <src_big>http://ip002.facebook.com/v11/135/18/8055/n1240077_30043525_2184.jpg</src_big>
596
+ <src_small>http://ip002.facebook.com/v11/135/18/8055/t1240077_30043525_2184.jpg</src_small>
597
+ <link>http://www.facebook.com/photo.php?pid=30043525&amp;id=8055</link>
598
+ <caption>Mexico City, back cover of the CYHS Student Underground 1999.</caption>
599
+ <created>1132553362</created>
600
+ </photo>
601
+ </photos_get_response>"
602
+ end
603
+
604
+ def example_events_get_xml
605
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
606
+ <events_get_response xmlns=\"http://api.facebook.com/1.0/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd\" list=\"true\">
607
+ <event>
608
+ <eid>29511517904</eid>
609
+ <name>PUMA SALE</name>
610
+ <tagline/>
611
+ <nid>0</nid>
612
+ <pic>http://profile.ak.facebook.com/object3/370/66/s29511517904_6952.jpg</pic>
613
+ <pic_big>http://profile.ak.facebook.com/object3/370/66/n29511517904_6952.jpg</pic_big>
614
+ <pic_small>http://profile.ak.facebook.com/object3/370/66/t29511517904_6952.jpg</pic_small>
615
+ <host>PUMA</host>
616
+ <description>PUMA SALE</description>
617
+ <event_type>Education</event_type>
618
+ <event_subtype>Study Group</event_subtype>
619
+ <start_time>1212166800</start_time>
620
+ <end_time>1212364800</end_time>
621
+ <creator>1234261165</creator>
622
+ <update_time>1209768148</update_time>
623
+ <location>PUMA LOT</location>
624
+ <venue>
625
+ <street>5 LYBERTY WAY</street>
626
+ <city>Westford</city>
627
+ <state>Massachusetts</state>
628
+ <country>United States</country>
629
+ <latitude>42.5792</latitude>
630
+ <longitude>-71.4383</longitude>
631
+ </venue>
632
+ </event>
633
+ </events_get_response>"
634
+ end
635
+
636
+ def example_users_get_info_xml
637
+ <<-XML
638
+ <?xml version="1.0" encoding="UTF-8"?> <users_getInfo_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true"> <user> <uid>8055</uid> <about_me>This field perpetuates the glorification of the ego. Also, it has a character limit.</about_me> <activities>Here: facebook, etc. There: Glee Club, a capella, teaching.</activities> <affiliations list="true"> <affiliation> <nid>50453093</nid> <name>Facebook Developers</name> <type>work</type> <status/> <year/> </affiliation> </affiliations> <birthday>November 3</birthday> <books>The Brothers K, GEB, Ken Wilber, Zen and the Art, Fitzgerald, The Emporer's New Mind, The Wonderful Story of Henry Sugar</books> <current_location> <city>Palo Alto</city> <state>CA</state> <country>United States</country> <zip>94303</zip> </current_location> <education_history list="true"> <education_info> <name>Harvard</name> <year>2003</year> <concentrations list="true"> <concentration>Applied Mathematics</concentration> <concentration>Computer Science</concentration> </concentrations> </education_info> </education_history> <first_name>Dave</first_name> <hometown_location> <city>York</city> <state>PA</state> <country>United States</country> </hometown_location> <hs_info> <hs1_name>Central York High School</hs1_name> <hs2_name/> <grad_year>1999</grad_year> <hs1_id>21846</hs1_id> <hs2_id>0</hs2_id> </hs_info> <is_app_user>1</is_app_user> <has_added_app>1</has_added_app> <interests>coffee, computers, the funny, architecture, code breaking,snowboarding, philosophy, soccer, talking to strangers</interests> <last_name>Fetterman</last_name> <locale>en_US</locale> <meeting_for list="true"> <seeking>Friendship</seeking> </meeting_for> <meeting_sex list="true"> <sex>female</sex> </meeting_sex> <movies>Tommy Boy, Billy Madison, Fight Club, Dirty Work, Meet the Parents, My Blue Heaven, Office Space </movies> <music>New Found Glory, Daft Punk, Weezer, The Crystal Method, Rage, the KLF, Green Day, Live, Coldplay, Panic at the Disco, Family Force 5</music> <name>Dave Fetterman</name> <notes_count>0</notes_count> <pic>http://photos-055.facebook.com/ip007/profile3/1271/65/s8055_39735.jpg</pic> <pic_big>http://photos-055.facebook.com/ip007/profile3/1271/65/n8055_39735.jpg</pic_big> <pic_small>http://photos-055.facebook.com/ip007/profile3/1271/65/t8055_39735.jpg</pic_small> <pic_square>http://photos-055.facebook.com/ip007/profile3/1271/65/q8055_39735.jpg</pic_square> <political>Moderate</political> <profile_update_time>1170414620</profile_update_time> <profile_url>http://www.facebook.com/profile.php?id=8055</profile_url> <quotes/> <relationship_status>In a Relationship</relationship_status> <religion/> <sex>male</sex> <significant_other_id xsi:nil="true"/> <status> <message>Fast Company, November issue, page 84</message> <time>1193075616</time> </status> <timezone>-8</timezone> <tv>cf. Bob Trahan</tv> <wall_count>121</wall_count> <work_history list="true"> <work_info> <location> <city>Palo Alto</city> <state>CA</state> <country>United States</country> </location> <company_name>Facebook</company_name> <position>Software Engineer</position> <description>Tech Lead, Facebook Platform</description> <start_date>2006-01</start_date> <end_date/> </work_info> </work_history> </user> </users_getInfo_response>
639
+ XML
640
+ end
641
+
642
+ def register_response_xml
643
+ <<-XML
644
+ <?xml version="1.0" encoding="UTF-8"?>
645
+ <connect_registerUsers_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/facebook.xsd" list="true">
646
+ <connect_registerUsers_response_elt>4228600737_c96da02bba97aedfd26136e980ae3761</connect_registerUsers_response_elt>
647
+ </connect_registerUsers_response>
648
+ XML
649
+ end
650
+
651
+ def unregister_response_xml
652
+ <<-XML
653
+ <?xml version="1.0" encoding="UTF-8"?>
654
+ <connect_unregisterUsers_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/facebook.xsd" list="true">
655
+ <connect_unregisterUsers_response_elt>4228600737_c96da02bba97aedfd26136e980ae3761</connect_unregisterUsers_response_elt>
656
+ </connect_unregisterUsers_response>
657
+ XML
658
+ end
659
+
660
+ def has_app_permission_response_xml
661
+ <<-XML
662
+ <?xml version="1.0" encoding="UTF-8"?>
663
+ <users_hasAppPermission_response xmlns="http://api.facebook.com/1.0/"
664
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
665
+ xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</users_hasAppPermission_response>
666
+ XML
667
+ end
668
+
669
+ def is_app_user_true_response_xml
670
+ <<-XML
671
+ <?xml version="1.0" encoding="UTF-8"?>
672
+ <users_isAppUser_response xmlns="http://api.facebook.com/1.0/"
673
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
674
+ xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</users_isAppUser_response>
675
+ XML
676
+ end
677
+
678
+ def is_app_user_false_response_xml
679
+ <<-XML
680
+ <?xml version="1.0" encoding="UTF-8"?>
681
+ <users_isAppUser_response xmlns="http://api.facebook.com/1.0/"
682
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
683
+ xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">0</users_isAppUser_response>
684
+ XML
685
+ end
686
+
687
+ def example_profile_publish_to_get_xml
688
+ <<-eoxml
689
+ <?xml version="1.0" encoding="UTF-8"?>
690
+ <stream_publish_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">703826862_78463536862</stream_publish_response>
691
+ eoxml
692
+ end
693
+
694
+ def example_comment_on_response
695
+ <<-eoxml
696
+ <?xml version="1.0" encoding="UTF-8"?>
697
+ <stream_addComment_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">703826862_78463536863</stream_addComment_response>
698
+ eoxml
699
+ end
700
+
701
+ def example_add_comment_response
702
+ <<-eoxml
703
+ <?xml version="1.0" encoding="UTF-8"?>
704
+ <comments_add_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">403917</comments_add_response>
705
+ eoxml
706
+ end
707
+
708
+ def example_add_like_on_response
709
+ <<-eoxml
710
+ <?xml version="1.0" encoding="UTF-8"?>
711
+ <stream_addLike_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</stream_addLike_response>
712
+ eoxml
713
+ end
714
+
715
+ def example_events_rsvp_xml
716
+ <<-E
717
+ <?xml version="1.0" encoding="UTF-8"?>
718
+ <events_rsvp_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
719
+ xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1
720
+ </events_rsvp_response>
721
+ E
722
+ end
723
+
724
+ def example_threads
725
+ <<-XML
726
+ <message_getThreadsInFolder_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
727
+ <thread>
728
+ <thread_id>1344434538976</thread_id>
729
+ <subject>Test attachments</subject>
730
+ <recipients list="true">
731
+ <uid>1410850842</uid>
732
+ <uid>662074872</uid>
733
+ </recipients>
734
+ <updated_time>1265723631</updated_time>
735
+ <parent_message_id>0</parent_message_id>
736
+ <parent_thread_id>0</parent_thread_id>
737
+ <message_count>3</message_count>
738
+ <snippet>one link attachment to a youtube video</snippet>
739
+ <snippet_author>1410850842</snippet_author>
740
+ <object_id>0</object_id>
741
+ <unread>0</unread>
742
+ <messages list="true">
743
+ <message>
744
+ <message_id>1344434538976_0</message_id>
745
+ <author_id>662074872</author_id>
746
+ <body>one photo attachment , 4KB jpeg image</body>
747
+ <created_time>1265723631</created_time>
748
+ <attachment>
749
+ <media list="true"/>
750
+ <href>http://www.facebook.com/photo.php?pid=3358326&amp;id=662074872</href>
751
+ <properties list="true"/>
752
+ <icon>http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif</icon>
753
+ <fb_object_type/>
754
+ <fb_object_id/>
755
+ <tagged_ids list="true"/>
756
+ </attachment>
757
+ <thread_id>1344434538976</thread_id>
758
+ </message>
759
+ <message>
760
+ <message_id>1344434538976_1</message_id>
761
+ <author_id>1410850842</author_id>
762
+ <body>one link attachment (http://www.facebook.com/l/e46dd;google.fr)</body>
763
+ <created_time>1265723941</created_time>
764
+ <attachment>
765
+ <media list="true">
766
+ <stream_media>
767
+ <href>http://www.facebook.com/l.php?u=http%253A%252F%252Fwww.google.fr%252F&amp;h=e46dd63cdbfadb74958fbe44e98f339c</href>
768
+ <type>link</type>
769
+ <src>http://external.ak.fbcdn.net/safe_image.php?d=dd54bba6b6e6479a89bb8084573c02c8&amp;w=90&amp;h=90&amp;url=http%3A%2F%2Fwww.google.fr%2Fintl%2Ffr_fr%2Fimages%2Flogo.gif</src>
770
+ </stream_media>
771
+ </media>
772
+ <name>Google</name>
773
+ <href>http://www.facebook.com/l.php?u=http%253A%252F%252Fwww.google.fr%252F&amp;h=e46dd63cdbfadb74958fbe44e98f339c</href>
774
+ <caption>www.google.fr</caption>
775
+ <properties list="true"/>
776
+ <icon>http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif</icon>
777
+ <fb_object_type/>
778
+ <fb_object_id/>
779
+ <tagged_ids list="true"/>
780
+ </attachment>
781
+ <thread_id>1344434538976</thread_id>
782
+ </message>
783
+ <message>
784
+ <message_id>1344434538976_2</message_id>
785
+ <author_id>1410850842</author_id>
786
+ <body>one link attachment to a youtube video</body>
787
+ <created_time>1265726503</created_time>
788
+ <attachment>
789
+ <media list="true">
790
+ <stream_media>
791
+ <href>http://www.facebook.com/l.php?u=http%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DAW-sNQUmUIM%2526feature%253Dpopular&amp;h=e46dd63cdbfadb74958fbe44e98f339c</href>
792
+ <alt>super bowl 44 highlights saints vs colts</alt>
793
+ <type>video</type>
794
+ <src>http://external.ak.fbcdn.net/safe_image.php?d=66f4aa965e2ae4a20a11c6a8ae3e4b1b&amp;w=90&amp;h=90&amp;url=http%3A%2F%2Fi.ytimg.com%2Fvi%2FAW-sNQUmUIM%2F2.jpg</src>
795
+ <video>
796
+ <display_url>http://www.youtube.com/watch?v=AW-sNQUmUIM&amp;feature=popular</display_url>
797
+ <source_url>http://www.youtube.com/v/AW-sNQUmUIM&amp;autoplay=1</source_url>
798
+ <owner>1410850842</owner>
799
+ <source_type>html</source_type>
800
+ </video>
801
+ </stream_media>
802
+ </media>
803
+ <name>super bowl 44 highlights saints vs colts</name>
804
+ <href>http://www.facebook.com/l.php?u=http%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DAW-sNQUmUIM%2526feature%253Dpopular&amp;h=e46dd63cdbfadb74958fbe44e98f339c</href>
805
+ <caption>www.youtube.com</caption>
806
+ <description>NFL super bowl 44 highlights saints vs colts from south florida.</description>
807
+ <properties list="true"/>
808
+ <icon>http://static.ak.fbcdn.net/rsrc.php/z9XZ8/hash/976ulj6z.gif</icon>
809
+ <fb_object_type/>
810
+ <fb_object_id/>
811
+ <tagged_ids list="true"/>
812
+ </attachment>
813
+ <thread_id>1344434538976</thread_id>
814
+ </message>
815
+ </messages>
816
+ </thread>
817
+ <thread>
818
+ <thread_id>1012985167472</thread_id>
819
+ <subject>Happy Holidays from the Facebook Platform Team</subject>
820
+ <recipients list="true">
821
+ <uid>220400</uid>
822
+ </recipients>
823
+ <updated_time>1230000685</updated_time>
824
+ <parent_message_id>0</parent_message_id>
825
+ <parent_thread_id>0</parent_thread_id>
826
+ <message_count>1</message_count>
827
+ <snippet>We wanted to take a moment and thank you for all of your great work and amazi...</snippet>
828
+ <snippet_author>220400</snippet_author>
829
+ <object_id>2205007948</object_id>
830
+ <unread>0</unread>
831
+ <messages list="true">
832
+ <message>
833
+ <message_id>1012985167472_0</message_id>
834
+ <author_id>220400</author_id>
835
+ <body>We wanted to take a moment and thank you for all of your great work and amazing applications that have helped make Facebook Platform the largest and fastest-growing social platform over the past year and a half. As we end 2008 there are over 660,000 of you worldwide building applications that give users more powerful ways to share and connect, and collectively your applications have reached nearly 140 million people.
836
+
837
+ Just recently, we've been excited to bring you Facebook Connect - allowing you to integrate the tools and features of Facebook Platform on your Websites, devices and desktop applications. In the next several months, we're looking forward to introducing additional improvements to help users more easily find your applications as well as launching the first sets of Verified Applications to users. If you haven't applied for verification yet, apply here:
838
+ http://developers.facebook.com/verification.php
839
+
840
+ Over the next year, we look forward to continued developments to improve Facebook Platform and help you reach and engage more users, and grow and sustain your business. We would love your feedback and input on what you think is most important - please take a few minutes and answer our survey here:
841
+
842
+ http://www.facebook.com/l/e46dd;https://www.questionpro.com/akira/TakeSurvey?id=1121648
843
+
844
+ From all of us at Facebook, we wish you and your families &quot;Happy Holidays,&quot; and we look forward to making the web even more social with you in 2009!</body>
845
+ <created_time>1230000042</created_time>
846
+ <attachment>
847
+ <media list="true"/>
848
+ <name>Feb 10, 2010 1:26pm</name>
849
+ <href>http://www.facebook.com/video/video.php?v=12345</href>
850
+ <properties list="true"/>
851
+ <icon>http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif</icon>
852
+ <fb_object_type/>
853
+ <fb_object_id/>
854
+ <tagged_ids list="true"/>
855
+ </attachment>
856
+ <thread_id>1012985167472</thread_id>
857
+ </message>
858
+ </messages>
859
+ </thread>
860
+ </message_getThreadsInFolder_response>
861
+ XML
862
+ end
863
+
864
+
865
+ def dashboard_get_count_xml
866
+ <<-XML
867
+ <?xml version="1.0" encoding="UTF-8"?>
868
+ <dashboard_getCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">12</dashboard_getCount_response>
869
+ XML
870
+ end
871
+
872
+ def dashboard_set_count_xml
873
+ <<-XML
874
+ <?xml version="1.0" encoding="UTF-8"?>
875
+ <dashboard_setCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</dashboard_setCount_response>
876
+ XML
877
+ end
878
+
879
+ def dashboard_increment_count_xml
880
+ <<-XML
881
+ <?xml version="1.0" encoding="UTF-8"?>
882
+ <dashboard_incrementCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</dashboard_incrementCount_response>
883
+ XML
884
+ end
885
+
886
+ def dashboard_decrement_count_xml
887
+ <<-XML
888
+ <?xml version="1.0" encoding="UTF-8"?>
889
+ <dashboard_decrementCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</dashboard_decrementCount_response>
890
+ XML
891
+ end
892
+
893
+ def dashboard_multi_set_count_xml
894
+ <<-XML
895
+ <?xml version="1.0" encoding="UTF-8"?>
896
+ <dashboard_multiSetCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
897
+ <dashboard_multiSetCount_response_elt key="1234">1</dashboard_multiSetCount_response_elt>
898
+ <dashboard_multiSetCount_response_elt key="4321">1</dashboard_multiSetCount_response_elt>
899
+ </dashboard_multiSetCount_response>
900
+ XML
901
+ end
902
+
903
+ def dashboard_multi_get_count_xml
904
+ <<-XML
905
+ <?xml version="1.0" encoding="UTF-8"?>
906
+ <dashboard_multiGetCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
907
+ <dashboard_multiGetCount_response_elt key="1234">11</dashboard_multiGetCount_response_elt>
908
+ <dashboard_multiGetCount_response_elt key="4321">22</dashboard_multiGetCount_response_elt>
909
+ </dashboard_multiGetCount_response>
910
+ XML
911
+ end
912
+
913
+ def dashboard_multi_increment_count_xml
914
+ <<-XML
915
+ <?xml version="1.0" encoding="UTF-8"?>
916
+ <dashboard_multiIncrementCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
917
+ <dashboard_multiIncrementCount_response_elt key="1234">1</dashboard_multiIncrementCount_response_elt>
918
+ <dashboard_multiIncrementCount_response_elt key="4321">1</dashboard_multiIncrementCount_response_elt>
919
+ </dashboard_multiIncrementCount_response>
920
+ XML
921
+ end
922
+
923
+ def dashboard_multi_decrement_count_xml
924
+ <<-XML
925
+ <?xml version="1.0" encoding="UTF-8"?>
926
+ <dashboard_multiDecrementCount_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
927
+ <dashboard_multiDecrementCount_response_elt key="1234">1</dashboard_multiDecrementCount_response_elt>
928
+ <dashboard_multiDecrementCount_response_elt key="4321">1</dashboard_multiDecrementCount_response_elt>
929
+ </dashboard_multiDecrementCount_response>
930
+ XML
931
+ end
932
+
933
+ def get_news_xml
934
+ <<-XML
935
+ <?xml version="1.0" encoding="UTF-8"?>
936
+ <dashboard_getNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
937
+ <dashboard_getNews_response_elt key="304847042079" list="true">
938
+ <dashboard_getNews_response_elt_elt key="image">http://facebook.er/icon.png</dashboard_getNews_response_elt_elt>
939
+ <dashboard_getNews_response_elt_elt key="news" list="true">
940
+ <dashboard_getNews_response_elt_elt_elt list="true">
941
+ <dashboard_getNews_response_elt_elt_elt_elt key="action_link" list="true">
942
+ <dashboard_getNews_response_elt_elt_elt_elt_elt key="href">http://facebook.er/</dashboard_getNews_response_elt_elt_elt_elt_elt>
943
+ <dashboard_getNews_response_elt_elt_elt_elt_elt key="text">I... I'm a test user</dashboard_getNews_response_elt_elt_elt_elt_elt>
944
+ </dashboard_getNews_response_elt_elt_elt_elt>
945
+ <dashboard_getNews_response_elt_elt_elt_elt key="message">Hey, who are you?</dashboard_getNews_response_elt_elt_elt_elt>
946
+ </dashboard_getNews_response_elt_elt_elt>
947
+ <dashboard_getNews_response_elt_elt_elt list="true">
948
+ <dashboard_getNews_response_elt_elt_elt_elt key="action_link" list="true">
949
+ <dashboard_getNews_response_elt_elt_elt_elt_elt key="href">http://facebook.er/</dashboard_getNews_response_elt_elt_elt_elt_elt>
950
+ <dashboard_getNews_response_elt_elt_elt_elt_elt key="text">I'm sorry</dashboard_getNews_response_elt_elt_elt_elt_elt>
951
+ </dashboard_getNews_response_elt_elt_elt_elt>
952
+ <dashboard_getNews_response_elt_elt_elt_elt key="message">Stop using my application, nerd</dashboard_getNews_response_elt_elt_elt_elt>
953
+ </dashboard_getNews_response_elt_elt_elt>
954
+ </dashboard_getNews_response_elt_elt>
955
+ <dashboard_getNews_response_elt_elt key="time">1266020260510</dashboard_getNews_response_elt_elt>
956
+ <dashboard_getNews_response_elt_elt key="fbid">304847042079</dashboard_getNews_response_elt_elt>
957
+ </dashboard_getNews_response_elt>
958
+ </dashboard_getNews_response>
959
+ XML
960
+ end
961
+
962
+ def add_news_xml
963
+ <<-XML
964
+ <?xml version="1.0" encoding="UTF-8"?>
965
+ <dashboard_addNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">316446838026</dashboard_addNews_response>
966
+ XML
967
+ end
968
+
969
+ def clear_news_xml
970
+ <<-XML
971
+ <?xml version="1.0" encoding="UTF-8"?>
972
+ <dashboard_clearNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
973
+ <dashboard_clearNews_response_elt key="362466171040">1</dashboard_clearNews_response_elt>
974
+ </dashboard_clearNews_response>
975
+ XML
976
+ end
977
+
978
+ def multi_add_news_xml
979
+ <<-XML
980
+ <?xml version="1.0" encoding="UTF-8"?>
981
+ <dashboard_multiAddNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
982
+ <dashboard_multiAddNews_response_elt key="1234">319103117527</dashboard_multiAddNews_response_elt>
983
+ <dashboard_multiAddNews_response_elt key="4321">313954287803</dashboard_multiAddNews_response_elt>
984
+ </dashboard_multiAddNews_response>
985
+ XML
986
+ end
987
+
988
+ def multi_get_news_xml
989
+ <<-XML
990
+ <?xml version="1.0" encoding="UTF-8"?>
991
+ <dashboard_multiGetNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
992
+ <dashboard_multiGetNews_response_elt key="1234" list="true">
993
+ <dashboard_multiGetNews_response_elt_elt key="319103117527" list="true">
994
+ <dashboard_multiGetNews_response_elt_elt_elt key="image">http://facebook.er/icon.png</dashboard_multiGetNews_response_elt_elt_elt>
995
+ <dashboard_multiGetNews_response_elt_elt_elt key="news" list="true">
996
+ <dashboard_multiGetNews_response_elt_elt_elt_elt list="true">
997
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt key="message">Hi user</dashboard_multiGetNews_response_elt_elt_elt_elt_elt>
998
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt key="action_link" list="true">
999
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt key="href">http://facebook.er/</dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt>
1000
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt key="text">Uh hey there app</dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt>
1001
+ </dashboard_multiGetNews_response_elt_elt_elt_elt_elt>
1002
+ </dashboard_multiGetNews_response_elt_elt_elt_elt>
1003
+ </dashboard_multiGetNews_response_elt_elt_elt>
1004
+ <dashboard_multiGetNews_response_elt_elt_elt key="time">1266605866056</dashboard_multiGetNews_response_elt_elt_elt>
1005
+ <dashboard_multiGetNews_response_elt_elt_elt key="fbid">319103117527</dashboard_multiGetNews_response_elt_elt_elt>
1006
+ </dashboard_multiGetNews_response_elt_elt>
1007
+ </dashboard_multiGetNews_response_elt>
1008
+ <dashboard_multiGetNews_response_elt key="4321" list="true">
1009
+ <dashboard_multiGetNews_response_elt_elt key="313954287803" list="true">
1010
+ <dashboard_multiGetNews_response_elt_elt_elt key="image">http://facebook.er/icon.png</dashboard_multiGetNews_response_elt_elt_elt>
1011
+ <dashboard_multiGetNews_response_elt_elt_elt key="news" list="true">
1012
+ <dashboard_multiGetNews_response_elt_elt_elt_elt list="true">
1013
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt key="message">Hi user</dashboard_multiGetNews_response_elt_elt_elt_elt_elt>
1014
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt key="action_link" list="true">
1015
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt key="href">http://facebook.er/</dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt>
1016
+ <dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt key="text">Uh hey there app</dashboard_multiGetNews_response_elt_elt_elt_elt_elt_elt>
1017
+ </dashboard_multiGetNews_response_elt_elt_elt_elt_elt>
1018
+ </dashboard_multiGetNews_response_elt_elt_elt_elt>
1019
+ </dashboard_multiGetNews_response_elt_elt_elt>
1020
+ <dashboard_multiGetNews_response_elt_elt_elt key="time">1266605866123</dashboard_multiGetNews_response_elt_elt_elt>
1021
+ <dashboard_multiGetNews_response_elt_elt_elt key="fbid">313954287803</dashboard_multiGetNews_response_elt_elt_elt>
1022
+ </dashboard_multiGetNews_response_elt_elt>
1023
+ </dashboard_multiGetNews_response_elt>
1024
+ </dashboard_multiGetNews_response>
1025
+ XML
1026
+ end
1027
+
1028
+ def multi_clear_news_xml
1029
+ <<-XML
1030
+ <?xml version="1.0" encoding="UTF-8"?><dashboard_multiClearNews_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
1031
+ <dashboard_multiClearNews_response_elt key="1234" list="true">
1032
+ <dashboard_multiClearNews_response_elt_elt key="319103117527">1</dashboard_multiClearNews_response_elt_elt>
1033
+ </dashboard_multiClearNews_response_elt>
1034
+ <dashboard_multiClearNews_response_elt key="4321" list="true">
1035
+ <dashboard_multiClearNews_response_elt_elt key="313954287803">1</dashboard_multiClearNews_response_elt_elt>
1036
+ </dashboard_multiClearNews_response_elt>
1037
+ </dashboard_multiClearNews_response>
1038
+ XML
1039
+ end
1040
+
1041
+ def publish_activity_xml
1042
+ <<-XML
1043
+ <?xml version="1.0" encoding="UTF-8"?>
1044
+ <dashboard_publishActivity_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">484161135393</dashboard_publishActivity_response>
1045
+ XML
1046
+ end
1047
+
1048
+ def get_activity_xml
1049
+ <<-XML
1050
+ <?xml version="1.0" encoding="UTF-8"?>
1051
+ <dashboard_getActivity_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
1052
+ <dashboard_getActivity_response_elt key="342454152268" list="true">
1053
+ <dashboard_getActivity_response_elt_elt key="message">{*actor*} rolled around</dashboard_getActivity_response_elt_elt>
1054
+ <dashboard_getActivity_response_elt_elt key="action_link" list="true">
1055
+ <dashboard_getActivity_response_elt_elt_elt key="href">http://facebook.er/</dashboard_getActivity_response_elt_elt_elt>
1056
+ <dashboard_getActivity_response_elt_elt_elt key="text">Roll around too</dashboard_getActivity_response_elt_elt_elt>
1057
+ </dashboard_getActivity_response_elt_elt>
1058
+ <dashboard_getActivity_response_elt_elt key="time">1266607632567</dashboard_getActivity_response_elt_elt>
1059
+ <dashboard_getActivity_response_elt_elt key="fbid">342454152268</dashboard_getActivity_response_elt_elt>
1060
+ </dashboard_getActivity_response_elt>
1061
+ </dashboard_getActivity_response>
1062
+ XML
1063
+ end
1064
+
1065
+ def remove_activity_xml
1066
+ <<-XML
1067
+ <?xml version="1.0" encoding="UTF-8"?>
1068
+ <dashboard_removeActivity_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
1069
+ <dashboard_removeActivity_response_elt key="342454152268">1</dashboard_removeActivity_response_elt>
1070
+ </dashboard_removeActivity_response>
1071
+ XML
1072
+ end
1073
+
1074
+ end