fotonauts-facebooker 1.0.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. data/.autotest +15 -0
  2. data/CHANGELOG.rdoc +24 -0
  3. data/COPYING.rdoc +19 -0
  4. data/Manifest.txt +152 -0
  5. data/README.rdoc +119 -0
  6. data/Rakefile +94 -0
  7. data/TODO.rdoc +4 -0
  8. data/examples/desktop_login.rb +14 -0
  9. data/facebooker.gemspec +45 -0
  10. data/generators/facebook/facebook_generator.rb +14 -0
  11. data/generators/facebook/templates/config/facebooker.yml +49 -0
  12. data/generators/facebook/templates/public/javascripts/facebooker.js +332 -0
  13. data/generators/facebook_controller/USAGE +33 -0
  14. data/generators/facebook_controller/facebook_controller_generator.rb +40 -0
  15. data/generators/facebook_controller/templates/controller.rb +7 -0
  16. data/generators/facebook_controller/templates/functional_test.rb +11 -0
  17. data/generators/facebook_controller/templates/helper.rb +2 -0
  18. data/generators/facebook_controller/templates/view.fbml.erb +2 -0
  19. data/generators/facebook_controller/templates/view.html.erb +2 -0
  20. data/generators/facebook_publisher/facebook_publisher_generator.rb +14 -0
  21. data/generators/facebook_publisher/templates/create_facebook_templates.rb +15 -0
  22. data/generators/facebook_publisher/templates/publisher.rb +3 -0
  23. data/generators/facebook_scaffold/USAGE +27 -0
  24. data/generators/facebook_scaffold/facebook_scaffold_generator.rb +118 -0
  25. data/generators/facebook_scaffold/templates/controller.rb +93 -0
  26. data/generators/facebook_scaffold/templates/facebook_style.css +2579 -0
  27. data/generators/facebook_scaffold/templates/functional_test.rb +89 -0
  28. data/generators/facebook_scaffold/templates/helper.rb +2 -0
  29. data/generators/facebook_scaffold/templates/layout.fbml.erb +6 -0
  30. data/generators/facebook_scaffold/templates/layout.html.erb +17 -0
  31. data/generators/facebook_scaffold/templates/style.css +74 -0
  32. data/generators/facebook_scaffold/templates/view_edit.fbml.erb +13 -0
  33. data/generators/facebook_scaffold/templates/view_edit.html.erb +18 -0
  34. data/generators/facebook_scaffold/templates/view_index.fbml.erb +24 -0
  35. data/generators/facebook_scaffold/templates/view_index.html.erb +24 -0
  36. data/generators/facebook_scaffold/templates/view_new.fbml.erb +12 -0
  37. data/generators/facebook_scaffold/templates/view_new.html.erb +17 -0
  38. data/generators/facebook_scaffold/templates/view_show.fbml.erb +10 -0
  39. data/generators/facebook_scaffold/templates/view_show.html.erb +10 -0
  40. data/generators/publisher/publisher_generator.rb +14 -0
  41. data/generators/xd_receiver/templates/xd_receiver.html +10 -0
  42. data/generators/xd_receiver/templates/xd_receiver_ssl.html +10 -0
  43. data/generators/xd_receiver/xd_receiver_generator.rb +10 -0
  44. data/init.rb +26 -0
  45. data/install.rb +12 -0
  46. data/lib/facebooker.rb +275 -0
  47. data/lib/facebooker/adapters/adapter_base.rb +91 -0
  48. data/lib/facebooker/adapters/bebo_adapter.rb +77 -0
  49. data/lib/facebooker/adapters/facebook_adapter.rb +60 -0
  50. data/lib/facebooker/admin.rb +42 -0
  51. data/lib/facebooker/application.rb +37 -0
  52. data/lib/facebooker/attachment.rb +51 -0
  53. data/lib/facebooker/batch_request.rb +45 -0
  54. data/lib/facebooker/data.rb +57 -0
  55. data/lib/facebooker/feed.rb +78 -0
  56. data/lib/facebooker/logging.rb +44 -0
  57. data/lib/facebooker/mobile.rb +20 -0
  58. data/lib/facebooker/mock/service.rb +50 -0
  59. data/lib/facebooker/mock/session.rb +18 -0
  60. data/lib/facebooker/model.rb +139 -0
  61. data/lib/facebooker/models/affiliation.rb +10 -0
  62. data/lib/facebooker/models/album.rb +11 -0
  63. data/lib/facebooker/models/applicationproperties.rb +39 -0
  64. data/lib/facebooker/models/applicationrestrictions.rb +10 -0
  65. data/lib/facebooker/models/comment.rb +9 -0
  66. data/lib/facebooker/models/cookie.rb +10 -0
  67. data/lib/facebooker/models/education_info.rb +11 -0
  68. data/lib/facebooker/models/event.rb +28 -0
  69. data/lib/facebooker/models/family_relative_info.rb +7 -0
  70. data/lib/facebooker/models/friend_list.rb +16 -0
  71. data/lib/facebooker/models/group.rb +36 -0
  72. data/lib/facebooker/models/info_item.rb +10 -0
  73. data/lib/facebooker/models/info_section.rb +10 -0
  74. data/lib/facebooker/models/location.rb +8 -0
  75. data/lib/facebooker/models/message_thread.rb +89 -0
  76. data/lib/facebooker/models/notifications.rb +17 -0
  77. data/lib/facebooker/models/page.rb +46 -0
  78. data/lib/facebooker/models/photo.rb +19 -0
  79. data/lib/facebooker/models/tag.rb +12 -0
  80. data/lib/facebooker/models/user.rb +751 -0
  81. data/lib/facebooker/models/video.rb +9 -0
  82. data/lib/facebooker/models/work_info.rb +10 -0
  83. data/lib/facebooker/parser.rb +970 -0
  84. data/lib/facebooker/rails/backwards_compatible_param_checks.rb +31 -0
  85. data/lib/facebooker/rails/controller.rb +353 -0
  86. data/lib/facebooker/rails/cucumber.rb +28 -0
  87. data/lib/facebooker/rails/cucumber/world.rb +40 -0
  88. data/lib/facebooker/rails/extensions/action_controller.rb +48 -0
  89. data/lib/facebooker/rails/extensions/rack_setup.rb +16 -0
  90. data/lib/facebooker/rails/extensions/routing.rb +15 -0
  91. data/lib/facebooker/rails/facebook_form_builder.rb +141 -0
  92. data/lib/facebooker/rails/facebook_pretty_errors.rb +22 -0
  93. data/lib/facebooker/rails/facebook_request_fix.rb +28 -0
  94. data/lib/facebooker/rails/facebook_request_fix_2-3.rb +31 -0
  95. data/lib/facebooker/rails/facebook_session_handling.rb +68 -0
  96. data/lib/facebooker/rails/facebook_url_helper.rb +192 -0
  97. data/lib/facebooker/rails/facebook_url_rewriting.rb +60 -0
  98. data/lib/facebooker/rails/helpers.rb +835 -0
  99. data/lib/facebooker/rails/helpers/fb_connect.rb +165 -0
  100. data/lib/facebooker/rails/helpers/stream_publish.rb +22 -0
  101. data/lib/facebooker/rails/integration_session.rb +38 -0
  102. data/lib/facebooker/rails/profile_publisher_extensions.rb +42 -0
  103. data/lib/facebooker/rails/publisher.rb +608 -0
  104. data/lib/facebooker/rails/routing.rb +49 -0
  105. data/lib/facebooker/rails/test_helpers.rb +68 -0
  106. data/lib/facebooker/rails/utilities.rb +22 -0
  107. data/lib/facebooker/server_cache.rb +24 -0
  108. data/lib/facebooker/service.rb +103 -0
  109. data/lib/facebooker/service/base_service.rb +19 -0
  110. data/lib/facebooker/service/curl_service.rb +44 -0
  111. data/lib/facebooker/service/net_http_service.rb +12 -0
  112. data/lib/facebooker/service/typhoeus_multi_service.rb +27 -0
  113. data/lib/facebooker/service/typhoeus_service.rb +17 -0
  114. data/lib/facebooker/session.rb +786 -0
  115. data/lib/facebooker/stream_post.rb +19 -0
  116. data/lib/facebooker/version.rb +9 -0
  117. data/lib/net/http_multipart_post.rb +123 -0
  118. data/lib/rack/facebook.rb +89 -0
  119. data/lib/rack/facebook_session.rb +21 -0
  120. data/lib/tasks/facebooker.rake +19 -0
  121. data/lib/tasks/facebooker.rb +2 -0
  122. data/lib/tasks/tunnel.rake +46 -0
  123. data/rails/init.rb +1 -0
  124. data/setup.rb +1585 -0
  125. data/templates/layout.erb +24 -0
  126. data/test/facebooker/adapters_test.rb +191 -0
  127. data/test/facebooker/admin_test.rb +102 -0
  128. data/test/facebooker/application_test.rb +110 -0
  129. data/test/facebooker/attachment_test.rb +72 -0
  130. data/test/facebooker/batch_request_test.rb +83 -0
  131. data/test/facebooker/data_test.rb +86 -0
  132. data/test/facebooker/logging_test.rb +43 -0
  133. data/test/facebooker/mobile_test.rb +45 -0
  134. data/test/facebooker/model_test.rb +133 -0
  135. data/test/facebooker/models/event_test.rb +15 -0
  136. data/test/facebooker/models/page_test.rb +56 -0
  137. data/test/facebooker/models/photo_test.rb +16 -0
  138. data/test/facebooker/models/user_test.rb +1074 -0
  139. data/test/facebooker/rails/facebook_request_fix_2-3_test.rb +25 -0
  140. data/test/facebooker/rails/facebook_url_rewriting_test.rb +76 -0
  141. data/test/facebooker/rails/integration_session_test.rb +13 -0
  142. data/test/facebooker/rails/publisher_test.rb +538 -0
  143. data/test/facebooker/rails_integration_test.rb +1543 -0
  144. data/test/facebooker/server_cache_test.rb +44 -0
  145. data/test/facebooker/service_test.rb +58 -0
  146. data/test/facebooker/session_test.rb +883 -0
  147. data/test/facebooker_test.rb +1263 -0
  148. data/test/fixtures/multipart_post_body_with_only_parameters.txt +33 -0
  149. data/test/fixtures/multipart_post_body_with_single_file.txt +38 -0
  150. data/test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt +38 -0
  151. data/test/net/http_multipart_post_test.rb +52 -0
  152. data/test/rack/facebook_session_test.rb +34 -0
  153. data/test/rack/facebook_test.rb +73 -0
  154. data/test/rails_test_helper.rb +36 -0
  155. data/test/test_helper.rb +74 -0
  156. metadata +303 -0
@@ -0,0 +1,15 @@
1
+ Autotest.add_hook(:initialize) do |at|
2
+ at.clear_mappings
3
+ at.find_directories = %w(lib test)
4
+
5
+ at.add_exception("test/test_helper.rb")
6
+ at.add_exception("test/rails_test_helper.rb")
7
+
8
+ at.add_mapping(/^lib\/.*\.rb$/) do |file, _|
9
+ at.files_matching(/^test\/.*_test\.rb$/)
10
+ end
11
+
12
+ at.add_mapping(/^test\/.*_test\.rb$/) do |file, _|
13
+ file
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ === HEAD
2
+
3
+ * New Features
4
+
5
+ * Facebooker::User#publish_to for publishing to a Wall or News Stream
6
+ * Optionally parses with Nokogiri. Just require 'nokogiri' in your app.
7
+
8
+ === 1.0.13 / 2009-02-26
9
+
10
+ * Modified fql_query to return results as Hashes as a last resort [Alan Larkin]
11
+ * fixed typo in set app properties parser [Andrew Grim, shane]
12
+ * Removed actor_id param from templatized feed [shane]
13
+ * Added admin.get_allocation [shane]
14
+ * Added data.get_cookies and data.set_cookie [shane]
15
+ * Added admin.get_app_properties and admin.set_app_properties [shane]
16
+
17
+ === 0.9.9 / 2008-09-08
18
+
19
+ * Re-package as gem after reworking for new API
20
+
21
+
22
+ === 0.9.5 / 2008-02-13
23
+
24
+ * Next release of documentation
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright (c) 2007 Chad Fowler <chad@infoether.com>
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ # this software and associated documentation files (the "Software"), to deal in the
6
+ # Software without restriction, including without limitation the rights to use,
7
+ # copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ # Software, and to permit persons to whom the Software is furnished to do so,
9
+ # subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18
+ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,152 @@
1
+ .autotest
2
+ CHANGELOG.rdoc
3
+ COPYING.rdoc
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ TODO.rdoc
8
+ examples/desktop_login.rb
9
+ facebooker.gemspec
10
+ generators/facebook/facebook_generator.rb
11
+ generators/facebook/templates/config/facebooker.yml
12
+ generators/facebook/templates/public/javascripts/facebooker.js
13
+ generators/facebook_controller/USAGE
14
+ generators/facebook_controller/facebook_controller_generator.rb
15
+ generators/facebook_controller/templates/controller.rb
16
+ generators/facebook_controller/templates/functional_test.rb
17
+ generators/facebook_controller/templates/helper.rb
18
+ generators/facebook_controller/templates/view.fbml.erb
19
+ generators/facebook_controller/templates/view.html.erb
20
+ generators/facebook_publisher/facebook_publisher_generator.rb
21
+ generators/facebook_publisher/templates/create_facebook_templates.rb
22
+ generators/facebook_publisher/templates/publisher.rb
23
+ generators/facebook_scaffold/USAGE
24
+ generators/facebook_scaffold/facebook_scaffold_generator.rb
25
+ generators/facebook_scaffold/templates/controller.rb
26
+ generators/facebook_scaffold/templates/facebook_style.css
27
+ generators/facebook_scaffold/templates/functional_test.rb
28
+ generators/facebook_scaffold/templates/helper.rb
29
+ generators/facebook_scaffold/templates/layout.fbml.erb
30
+ generators/facebook_scaffold/templates/layout.html.erb
31
+ generators/facebook_scaffold/templates/style.css
32
+ generators/facebook_scaffold/templates/view_edit.fbml.erb
33
+ generators/facebook_scaffold/templates/view_edit.html.erb
34
+ generators/facebook_scaffold/templates/view_index.fbml.erb
35
+ generators/facebook_scaffold/templates/view_index.html.erb
36
+ generators/facebook_scaffold/templates/view_new.fbml.erb
37
+ generators/facebook_scaffold/templates/view_new.html.erb
38
+ generators/facebook_scaffold/templates/view_show.fbml.erb
39
+ generators/facebook_scaffold/templates/view_show.html.erb
40
+ generators/publisher/publisher_generator.rb
41
+ generators/xd_receiver/templates/xd_receiver_ssl.html
42
+ generators/xd_receiver/templates/xd_receiver.html
43
+ generators/xd_receiver/xd_receiver_generator.rb
44
+ init.rb
45
+ install.rb
46
+ lib/facebooker.rb
47
+ lib/facebooker/adapters/adapter_base.rb
48
+ lib/facebooker/adapters/bebo_adapter.rb
49
+ lib/facebooker/adapters/facebook_adapter.rb
50
+ lib/facebooker/attachment.rb
51
+ lib/facebooker/admin.rb
52
+ lib/facebooker/application.rb
53
+ lib/facebooker/batch_request.rb
54
+ lib/facebooker/data.rb
55
+ lib/facebooker/feed.rb
56
+ lib/facebooker/logging.rb
57
+ lib/facebooker/mobile.rb
58
+ lib/facebooker/mock/service.rb
59
+ lib/facebooker/mock/session.rb
60
+ lib/facebooker/model.rb
61
+ lib/facebooker/models/affiliation.rb
62
+ lib/facebooker/models/album.rb
63
+ lib/facebooker/models/applicationproperties.rb
64
+ lib/facebooker/models/applicationrestrictions.rb
65
+ lib/facebooker/models/cookie.rb
66
+ lib/facebooker/models/comment.rb
67
+ lib/facebooker/models/education_info.rb
68
+ lib/facebooker/models/event.rb
69
+ lib/facebooker/models/family_relative_info.rb
70
+ lib/facebooker/models/friend_list.rb
71
+ lib/facebooker/models/group.rb
72
+ lib/facebooker/models/info_item.rb
73
+ lib/facebooker/models/info_section.rb
74
+ lib/facebooker/models/location.rb
75
+ lib/facebooker/models/notifications.rb
76
+ lib/facebooker/models/page.rb
77
+ lib/facebooker/models/photo.rb
78
+ lib/facebooker/models/tag.rb
79
+ lib/facebooker/models/user.rb
80
+ lib/facebooker/models/video.rb
81
+ lib/facebooker/models/work_info.rb
82
+ lib/facebooker/models/message_thread.rb
83
+ lib/facebooker/parser.rb
84
+ lib/facebooker/rails/backwards_compatible_param_checks.rb
85
+ lib/facebooker/rails/controller.rb
86
+ lib/facebooker/rails/cucumber.rb
87
+ lib/facebooker/rails/cucumber/world.rb
88
+ lib/facebooker/rails/extensions/action_controller.rb
89
+ lib/facebooker/rails/extensions/rack_setup.rb
90
+ lib/facebooker/rails/extensions/routing.rb
91
+ lib/facebooker/rails/facebook_form_builder.rb
92
+ lib/facebooker/rails/facebook_pretty_errors.rb
93
+ lib/facebooker/rails/facebook_request_fix.rb
94
+ lib/facebooker/rails/facebook_request_fix_2-3.rb
95
+ lib/facebooker/rails/facebook_session_handling.rb
96
+ lib/facebooker/rails/facebook_url_helper.rb
97
+ lib/facebooker/rails/facebook_url_rewriting.rb
98
+ lib/facebooker/rails/helpers.rb
99
+ lib/facebooker/rails/helpers/fb_connect.rb
100
+ lib/facebooker/rails/helpers/stream_publish.rb
101
+ lib/facebooker/rails/integration_session.rb
102
+ lib/facebooker/rails/profile_publisher_extensions.rb
103
+ lib/facebooker/rails/publisher.rb
104
+ lib/facebooker/rails/routing.rb
105
+ lib/facebooker/rails/test_helpers.rb
106
+ lib/facebooker/rails/utilities.rb
107
+ lib/facebooker/server_cache.rb
108
+ lib/facebooker/service.rb
109
+ lib/facebooker/service/base_service.rb
110
+ lib/facebooker/service/curl_service.rb
111
+ lib/facebooker/service/net_http_service.rb
112
+ lib/facebooker/service/typhoeus_service.rb
113
+ lib/facebooker/service/typhoeus_multi_service.rb
114
+ lib/facebooker/session.rb
115
+ lib/facebooker/stream_post.rb
116
+ lib/facebooker/version.rb
117
+ lib/net/http_multipart_post.rb
118
+ lib/rack/facebook.rb
119
+ lib/rack/facebook_session.rb
120
+ lib/tasks/facebooker.rake
121
+ lib/tasks/facebooker.rb
122
+ lib/tasks/tunnel.rake
123
+ rails/init.rb
124
+ setup.rb
125
+ templates/layout.erb
126
+ test/facebooker/adapters_test.rb
127
+ test/facebooker/admin_test.rb
128
+ test/facebooker/application_test.rb
129
+ test/facebooker/attachment_test.rb
130
+ test/facebooker/batch_request_test.rb
131
+ test/facebooker/data_test.rb
132
+ test/facebooker/logging_test.rb
133
+ test/facebooker/mobile_test.rb
134
+ test/facebooker/model_test.rb
135
+ test/facebooker/models/event_test.rb
136
+ test/facebooker/models/page_test.rb
137
+ test/facebooker/models/photo_test.rb
138
+ test/facebooker/models/user_test.rb
139
+ test/facebooker/rails/publisher_test.rb
140
+ test/facebooker/rails_integration_test.rb
141
+ test/facebooker/rails/facebook_request_fix_2-3_test.rb
142
+ test/facebooker/server_cache_test.rb
143
+ test/facebooker/session_test.rb
144
+ test/facebooker_test.rb
145
+ test/fixtures/multipart_post_body_with_only_parameters.txt
146
+ test/fixtures/multipart_post_body_with_single_file.txt
147
+ test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt
148
+ test/net/http_multipart_post_test.rb
149
+ test/rack/facebook_test.rb
150
+ test/rack/facebook_session_test.rb
151
+ test/rails_test_helper.rb
152
+ test/test_helper.rb
@@ -0,0 +1,119 @@
1
+ = Facebooker
2
+
3
+ * http://facebooker.rubyforge.org
4
+
5
+ == DESCRIPTION:
6
+
7
+ Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]. Its goals are:
8
+
9
+ * Idiomatic Ruby
10
+ * No dependencies outside of the Ruby standard library (This is true with Rails 2.1. Previous Rails versions require the JSON gem)
11
+ * Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available
12
+ * Well tested
13
+
14
+
15
+ == FEATURES/PROBLEMS:
16
+
17
+ * Idiomatic Ruby
18
+ * No dependencies outside of the Ruby standard library
19
+ * Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available
20
+ * Well tested
21
+
22
+ == SYNOPSIS:
23
+
24
+ View David Clements' {excellent tutorial}[http://apps.facebook.com/facebooker_tutorial] at {http://apps.facebook.com/facebooker_tutorial/}[http://apps.facebook.com/facebooker_tutorial] or check out {Developing Facebook Platform Applications with Rails}[http://www.pragprog.com/titles/mmfacer].
25
+ {Join the Mailing List}:[groups.google.com/group/facebooker]
26
+
27
+ == REQUIREMENTS:
28
+
29
+ None
30
+
31
+ == INSTALL:
32
+
33
+ === Non Rails
34
+
35
+ The best way is:
36
+
37
+ gem install facebooker
38
+
39
+ If, for some reason, you can't/won't use RubyGems, you can do:
40
+
41
+ (sudo) ruby setup.rb
42
+
43
+ === Rails
44
+
45
+ Facebooker can be installed as a Rails plugin by:
46
+
47
+ script/plugin install git://github.com/mmangino/facebooker.git
48
+
49
+ If you don't have git, the plugin can be downloaded from http://github.com/mmangino/facebooker/tarball/master
50
+
51
+ === Using Gem in Rails
52
+
53
+ The rake task would not be added automatically, so to use it in rails you would have to add the following towards the end of your Rakefile:
54
+
55
+ require 'tasks/facebooker'
56
+
57
+ Once the plugin is installed, you will need to configure your Facebook app in config/facebooker.yml.
58
+
59
+ Your application users will need to have added the application in facebook to access all of facebooker's features. You enforce this by adding
60
+
61
+ ensure_application_is_installed_by_facebook_user
62
+
63
+ to your application controller.
64
+
65
+ To prevent a violation of Facebook Terms of Service while reducing log bloat, you should also add
66
+
67
+ filter_parameter_logging :fb_sig_friends
68
+
69
+ to your application controller.
70
+
71
+ == using MemCache session
72
+
73
+ Facebook uses some non alphanum characters in the session identifier which interfere with memcache stored sessions. If you want to use MemCache for storing sessions, you can override the valid session id method on memcache by placing the following code in an initializer:
74
+
75
+ # add - as an okay key
76
+ class CGI
77
+ class Session
78
+ class MemCacheStore
79
+ def check_id(id) #:nodoc:#
80
+ /[^0-9a-zA-Z\-\._]+/ =~ id.to_s ? false : true
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ == Other versions
87
+
88
+ A facebooker port for Sinatra is available at http://github.com/jsmestad/frankie/tree/master
89
+
90
+ == LICENSE:
91
+
92
+ (The MIT License)
93
+
94
+ Copyright (c) 2008-2009:
95
+
96
+ * Chad Fowler
97
+ * Patrick Ewing
98
+ * Mike Mangino
99
+ * Shane Vitarana
100
+ * Corey Innis
101
+
102
+ Permission is hereby granted, free of charge, to any person obtaining
103
+ a copy of this software and associated documentation files (the
104
+ 'Software'), to deal in the Software without restriction, including
105
+ without limitation the rights to use, copy, modify, merge, publish,
106
+ distribute, sublicense, and/or sell copies of the Software, and to
107
+ permit persons to whom the Software is furnished to do so, subject to
108
+ the following conditions:
109
+
110
+ The above copyright notice and this permission notice shall be
111
+ included in all copies or substantial portions of the Software.
112
+
113
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
114
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
115
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
116
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
117
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
118
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
119
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,94 @@
1
+ # -*- ruby -*-
2
+ #
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ begin
6
+ require 'load_multi_rails_rake_tasks'
7
+ rescue LoadError
8
+ $stderr.puts "Install the multi_rails gem to run tests against multiple versions of Rails"
9
+ end
10
+
11
+ require 'lib/facebooker/version'
12
+
13
+ HOE = Hoe.spec('facebooker') do
14
+ self.version = Facebooker::VERSION::STRING
15
+ self.rubyforge_name = 'facebooker'
16
+ developer 'Chad Fowler', 'chad@chadfowlwer.com'
17
+ developer 'Patrick Ewing', ''
18
+ developer 'Mike Mangino', ''
19
+ developer 'Shane Vitarana', ''
20
+ developer 'Corey Innis', ''
21
+ developer 'Mike Mangino', 'mmangino@elevatedrails.com'
22
+
23
+ self.readme_file = 'README.rdoc'
24
+ self.history_file = 'CHANGELOG.rdoc'
25
+ self.remote_rdoc_dir = '' # Release to root
26
+ self.test_globs = ['test/**/*_test.rb']
27
+ extra_deps << ['json_pure', '>= 1.0.0']
28
+ self.extra_rdoc_files = FileList['*.rdoc']
29
+ end
30
+
31
+ begin
32
+ require 'rcov/rcovtask'
33
+
34
+ namespace :test do
35
+ namespace :coverage do
36
+ desc "Delete aggregate coverage data."
37
+ task(:clean) { rm_f "coverage.data" }
38
+ end
39
+ desc 'Aggregate code coverage for unit, functional and integration tests'
40
+ Rcov::RcovTask.new(:coverage) do |t|
41
+ t.libs << "test"
42
+ t.test_files = FileList["test/**/*_test.rb"]
43
+ t.output_dir = "coverage/"
44
+ t.verbose = true
45
+ t.rcov_opts = ['--exclude', 'test,/usr/lib/ruby,/Library/Ruby,/System/Library', '--sort', 'coverage']
46
+ end
47
+ end
48
+ rescue LoadError
49
+ $stderr.puts "Install the rcov gem to enable test coverage analysis"
50
+ end
51
+
52
+ namespace :gem do
53
+ task :spec do
54
+ File.open("#{HOE.name}.gemspec", 'w') do |f|
55
+ f.write(HOE.spec.to_ruby)
56
+ end
57
+ end
58
+
59
+ namespace :spec do
60
+ task :dev do
61
+ File.open("#{HOE.name}.gemspec", 'w') do |f|
62
+ HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
63
+ f.write(HOE.spec.to_ruby)
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ # vim: syntax=Ruby
70
+ #
71
+ #
72
+ # require File.dirname(__FILE__) + '/vendor/gardener/lib/gardener'
73
+ #
74
+ # require 'facebooker'
75
+ #
76
+ # namespace :doc do
77
+ # task :readme do
78
+ # puts "Readme"
79
+ # end
80
+ # end
81
+ #
82
+ # Gardener.configure do
83
+ # gem_spec do |spec|
84
+ # spec.name = 'facebooker'
85
+ # spec.version = Gem::Version.new(Facebooker::VERSION::STRING)
86
+ # spec.summary = "Pure, idiomatic Ruby wrapper for the Facebook REST API."
87
+ # spec.email = 'chad@infoether.com'
88
+ # spec.author = ['Chad Fowler', 'Patrick Ewing','Mike Mangino','Shane Vitarana']
89
+ # spec.extra_rdoc_files = %w(COPYING)
90
+ # spec.rdoc_options = ['--title', "Gardener",
91
+ # '--main', 'README',
92
+ # '--line-numbers', '--inline-source']
93
+ # end
94
+ # end
@@ -0,0 +1,4 @@
1
+ [ ] Document session handling. Come up with different cases and paths for the flow and create tests for each
2
+ [ ] Verify that sessions are used only where required. Raise exceptions on User methods that require a session when none is available
3
+ [ ] Refactor setup / Adapter loading code
4
+
@@ -0,0 +1,14 @@
1
+ $: << File.join(File.dirname(__FILE__), "..", 'lib')
2
+ require 'facebooker'
3
+ load "~/.facebooker" rescue fail("You'll need to specify API_KEY and SECRET_KEY to run this example. One way to do that would be to put them in ~/.facebooker")
4
+ session = Facebooker::Session::Desktop.create(API_KEY, SECRET_KEY)
5
+ puts session.login_url
6
+ gets
7
+
8
+ session.user.friends!.each do |user|
9
+ puts "#{user.id}:#{user.name}"
10
+ end
11
+ # This time all the data is there because friends! has already retrieved it.
12
+ session.user.friends.each do |user|
13
+ puts "#{user.id}:#{user.name}"
14
+ end