Joseph Durden
2008-Nov-14 12:43 UTC
[Facebooker-talk] parameters for fb_sig_ext_perms =>not showing up???
Hello everyone, I am using fb_prompt_permission :email, "Give Permission!" and it is working properly. A user can give permission and my app can then send emails to users. I have a requirement that I have to document that a user has granted this email extended permission. I don''t see the params for fb_sig_ext_perms => email? Why is this not showing up? Could this be the facebooker plugin or is it the actual www.facebook.com api? I noticed the fb_sig_ext_perms before filters although I dont need them before_filter :ensure_has_status_update before_filter :ensure_has_photo_upload before_filter :ensure_has_create_listing i have tested the above out, and i properly receive the params for status, photo and create. How can I get the email permissions sent as a params? I have also tried using fql to grab the email permissions for a given user. Here is the fql:>> current_user.facebook_session.fql_query("select email from permissionswhere uid = (#{current_user.facebook_id})") => [nil] I think that my fql is working properly but not sure. If anyone knows how to get the email sent in params or how to write a fql query that can give me the params I would be extatic! Here are my params: Parameters: {"fb_sig_time"=>"1221234687.6134", "fb_sig"=>"1234gsdrgdfh4634534yhdsrt6345634", "fb_sig_in_new_facebook"=>"1", "_method"=>"GET", "fb_sig_locale"=>"en_US", "action"=>"index", "fb_sig_session_key"=>"2354sdfgew563455sgerd34-1231241244", "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", "fb_sig_request_method"=>"GET", "controller"=>"home", "fb_sig_expires"=>"123345234234", "fb_sig_added"=>"1", "fb_sig_friends"=>"1153203682,1154273529,1189153592,1209608725,1212782770", "fb_sig_api_key"=>"1sd234243235235sdgttwet2354g345tr3", "fb_sig_ext_perms"=>"status_update,photo_upload,create_listing", "fb_sig_user"=>"12342342342", "fb_sig_profile_update_time"=>"1226123330"} as you can see there are no fb_sig_ext_perms. JD -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20081114/560aebcd/attachment.html>
vincent chu
2008-Nov-19 18:42 UTC
[Facebooker-talk] parameters for fb_sig_ext_perms =>not showing up???
Hi ---
I just added a ''get_permissions'' method to my FacebookUser
model that
queries facebook for a user''s extended permissions. Your FQL query
seems correct, but you have to call ''post'', instead of
''fql_query'':
def get_permissions
perms = Hash.new
begin
current_session = self.facebook_session
current_session.post("facebook.fql.query",
:query => "select email, offline_access,
status_update, photo_upload, create_listing, create_event, rsvp_event,
sms from permissions where uid=#{self.facebook_id}",
:format => "XML") do |response|
type = response.shift
if (type != "permissions")
return perms
end
response.shift.map do |hash|
hash.each_pair{|key, value| (value == "1" ? perms.store(key,
true) : perms.store(key, false) )}
end
end
return perms
rescue
return nil
end
end
Hope this helps. Cheers,
Vince
----
Vincent Chu
Department of Applied Physics
Geballe Laboratory of Advanced Materials
McCullough Bldg. 318
476 Lomita Mall
Stanford, CA, 94305
vchu AT post.harvard.edu
vincentchu AT gmail.com
http://www.stanford.edu/~vincentc (homepage, updated sporadically)
Consider this:
"The smallest positive integer not definable in under eleven words."
On Fri, Nov 14, 2008 at 4:43 AM, Joseph Durden <josephdurden at gmail.com>
wrote:> Hello everyone,
>
> I am using fb_prompt_permission :email, "Give Permission!" and it
is working
> properly. A user can give permission and my app can then send emails to
> users.
>
> I have a requirement that I have to document that a user has granted this
> email extended permission. I don''t see the params for
fb_sig_ext_perms =>
> email? Why is this not showing up? Could this be the facebooker plugin or
> is it the actual www.facebook.com api? I noticed the fb_sig_ext_perms
> before filters although I dont need them
>
> before_filter :ensure_has_status_update
> before_filter :ensure_has_photo_upload
> before_filter :ensure_has_create_listing
>
>
> i have tested the above out, and i properly receive the params for status,
> photo and create. How can I get the email permissions sent as a params? I
> have also tried using fql to grab the email permissions for a given user.
> Here is the fql:
>
>>> current_user.facebook_session.fql_query("select email from
permissions
>>> where uid = (#{current_user.facebook_id})")
> => [nil]
>
> I think that my fql is working properly but not sure.
>
> If anyone knows how to get the email sent in params or how to write a fql
> query that can give me the params I would be extatic!
>
> Here are my params:
>
> Parameters: {"fb_sig_time"=>"1221234687.6134",
> "fb_sig"=>"1234gsdrgdfh4634534yhdsrt6345634",
"fb_sig_in_new_facebook"=>"1",
> "_method"=>"GET",
"fb_sig_locale"=>"en_US",
"action"=>"index",
>
"fb_sig_session_key"=>"2354sdfgew563455sgerd34-1231241244",
> "fb_sig_position_fix"=>"1",
"fb_sig_in_canvas"=>"1",
> "fb_sig_request_method"=>"GET",
"controller"=>"home",
> "fb_sig_expires"=>"123345234234",
"fb_sig_added"=>"1",
>
"fb_sig_friends"=>"1153203682,1154273529,1189153592,1209608725,1212782770",
>
"fb_sig_api_key"=>"1sd234243235235sdgttwet2354g345tr3",
>
"fb_sig_ext_perms"=>"status_update,photo_upload,create_listing",
> "fb_sig_user"=>"12342342342",
"fb_sig_profile_update_time"=>"1226123330"}
>
> as you can see there are no fb_sig_ext_perms.
>
> JD
>
> _______________________________________________
> Facebooker-talk mailing list
> Facebooker-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/facebooker-talk
>
>
Joseph Durden
2008-Nov-20 08:02 UTC
[Facebooker-talk] parameters for fb_sig_ext_perms =>not showing up???
Thanks Vincent. You solution works great. JD On Wed, Nov 19, 2008 at 10:42 AM, vincent chu <vincentchu at gmail.com> wrote:> Hi --- > > I just added a ''get_permissions'' method to my FacebookUser model that > queries facebook for a user''s extended permissions. Your FQL query > seems correct, but you have to call ''post'', instead of ''fql_query'': > > def get_permissions > > perms = Hash.new > > begin > current_session = self.facebook_session > current_session.post("facebook.fql.query", > :query => "select email, offline_access, > status_update, photo_upload, create_listing, create_event, rsvp_event, > sms from permissions where uid=#{self.facebook_id}", > :format => "XML") do |response| > > type = response.shift > if (type != "permissions") > return perms > end > > response.shift.map do |hash| > hash.each_pair{|key, value| (value == "1" ? perms.store(key, > true) : perms.store(key, false) )} > end > end > > return perms > > rescue > return nil > end > > end > > > Hope this helps. Cheers, > > Vince > > ---- > Vincent Chu > Department of Applied Physics > Geballe Laboratory of Advanced Materials > McCullough Bldg. 318 > 476 Lomita Mall > Stanford, CA, 94305 > > vchu AT post.harvard.edu > vincentchu AT gmail.com > > http://www.stanford.edu/~vincentc <http://www.stanford.edu/%7Evincentc>(homepage, updated sporadically) > > Consider this: > "The smallest positive integer not definable in under eleven words." > > > > On Fri, Nov 14, 2008 at 4:43 AM, Joseph Durden <josephdurden at gmail.com> > wrote: > > Hello everyone, > > > > I am using fb_prompt_permission :email, "Give Permission!" and it is > working > > properly. A user can give permission and my app can then send emails to > > users. > > > > I have a requirement that I have to document that a user has granted this > > email extended permission. I don''t see the params for fb_sig_ext_perms > => > > email? Why is this not showing up? Could this be the facebooker plugin > or > > is it the actual www.facebook.com api? I noticed the fb_sig_ext_perms > > before filters although I dont need them > > > > before_filter :ensure_has_status_update > > before_filter :ensure_has_photo_upload > > before_filter :ensure_has_create_listing > > > > > > i have tested the above out, and i properly receive the params for > status, > > photo and create. How can I get the email permissions sent as a params? > I > > have also tried using fql to grab the email permissions for a given user. > > Here is the fql: > > > >>> current_user.facebook_session.fql_query("select email from permissions > >>> where uid = (#{current_user.facebook_id})") > > => [nil] > > > > I think that my fql is working properly but not sure. > > > > If anyone knows how to get the email sent in params or how to write a fql > > query that can give me the params I would be extatic! > > > > Here are my params: > > > > Parameters: {"fb_sig_time"=>"1221234687.6134", > > "fb_sig"=>"1234gsdrgdfh4634534yhdsrt6345634", > "fb_sig_in_new_facebook"=>"1", > > "_method"=>"GET", "fb_sig_locale"=>"en_US", "action"=>"index", > > "fb_sig_session_key"=>"2354sdfgew563455sgerd34-1231241244", > > "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", > > "fb_sig_request_method"=>"GET", "controller"=>"home", > > "fb_sig_expires"=>"123345234234", "fb_sig_added"=>"1", > > > "fb_sig_friends"=>"1153203682,1154273529,1189153592,1209608725,1212782770", > > "fb_sig_api_key"=>"1sd234243235235sdgttwet2354g345tr3", > > "fb_sig_ext_perms"=>"status_update,photo_upload,create_listing", > > "fb_sig_user"=>"12342342342", "fb_sig_profile_update_time"=>"1226123330"} > > > > as you can see there are no fb_sig_ext_perms. > > > > JD > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20081120/0bebdc83/attachment-0001.html>