Hi there. I am trying to set a preload_fql property for my app I am using the following code, but I get an error evaluating nil.new from parser.rb prop=''{"preload_fql" : "{\"friends\" : {\"pattern\": \".*\", \"query\" : \"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 {*user*}) ORDER BY name \"}}"}'' x=@current_facebook_session.admin.set_app_properties({:preload_fql=>prop}) the same preload_fql rule works when i set it with rFacebook so I know thats not the problem , any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080227/1da6aee5/attachment.html
Yuval- You should be able to create a hash instead of manually creating the json. Facebooker will automatically convert the hash to json and submit it. i.e: properties = { :preload_fql => { :friends => "pattern", :query => "blah" } } Can you paste the result of the response so I can see why the parsing is failing? Thanks, Shane On Wed, Feb 27, 2008 at 12:26 PM, yuval markovich <uvmarko at gmail.com> wrote:> Hi there. > > I am trying to set a preload_fql property for my app > I am using the following code, but I get an error evaluating nil.new from > parser.rb > > prop=''{"preload_fql" : "{\"friends\" : {\"pattern\": \".*\", \"query\" : > \"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 > {*user*}) ORDER BY name \"}}"}'' > x=@current_facebook_session.admin.set_app_properties({:preload_fql=>prop}) > > the same preload_fql rule works when i set it with rFacebook so I know thats > not the problem , any suggestions? > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Hi Andrew, I tried it and I got the same response: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.new ... vendor/plugins/facebooker/lib/facebooker/parser.rb:363:in `process'' vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse'' vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post'' vendor/plugins/facebooker/lib/facebooker/session.rb:325:in `post'' vendor/plugins/facebooker/lib/facebooker/admin.rb:11:in `set_app_properties'' ... Thanks a lot, Yuval On Wed, Feb 27, 2008 at 9:00 PM, Andrew Grim <stopdropandrew at gmail.com> wrote:> Try changing this in parser.rb > > class SetAppProperties < Parser#:nodoc: > def self.process(data) > - element(''data_setAppProperties_response'', data).text_value > + element(''admin_setAppProperties_response'', data).text_value > end > end > > > > On Wed, Feb 27, 2008 at 10:26 AM, yuval markovich <uvmarko at gmail.com> wrote: > > > > > > > > > Hi there. > > > > I am trying to set a preload_fql property for my app > > I am using the following code, but I get an error evaluating nil.new from > parser.rb > > > > prop=''{"preload_fql" : "{\"friends\" : {\"pattern\": \".*\", \"query\" : > \"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 > {*user*}) ORDER BY name \"}}"}'' > > x=@current_facebook_session.admin.set_app_properties({:preload_fql=>prop}) > > > > the same preload_fql rule works when i set it with rFacebook so I know > thats not the problem , any suggestions? > > > > > > > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > >