From jnylund at yahoo.com Fri Feb 1 09:40:27 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Fri, 1 Feb 2008 09:40:27 -0500 Subject: [Facebooker-talk] facebook_url_rewriting.rb In-Reply-To: <20080129150101916705.ebab03c9@gmail.com> References: <20080128205258613970.8b92ad85@gmail.com> <92A9C88C-FA9D-4AA4-84F5-7FE714491E63@gmail.com> <20080129101945834192.5a645951@gmail.com> <8522FB7F-E88B-4D79-9C52-3FB786ACCA36@gmail.com> <20080129122045533499.e1089f89@gmail.com> <4ab757a40801291310g7c0815fejb2b10f4fd832336b@mail.gmail.com> <20080129150101916705.ebab03c9@gmail.com> Message-ID: <1523F134-E574-46DC-B75A-A2657459BA47@yahoo.com> Hey guys, I have tested Shawn's patch on my application and it works great, please let me know when its checked in so I can update the example on my blog to use that approach as its much cleaner than the way I was doing things. One thing you may want to add to the documentation to be clear is that in order to work you must set your facebook callback url in facebook to include the namespace with a trailing slash, a precise example: Namespace sandbox: facebook callback url - http://yoururl:yourport/namespace/ ENV['FACEBOOKER_SANDBOX_NAMESPACE'] = '/namespace' thanks Joel On Jan 29, 2008, at 5:01 PM, Shawn Van Ittersum wrote: > Works for me. Thanks, guys! > > Shawn > > On Tue, 29 Jan 2008 15:32:10 -0600, Michael Niessner wrote: >> Shane's idea is the winner. When facebooker.yml parses callback_url >> it can put the host component in where it currently does and stuff >> the path into ENV['FACEBOOKER_SANDBOX_NAMESPACE']. Then developers >> only need to copy their callback_url into callback_url of >> facebooker.yml. >> >> Michael Niessner >> >> On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote: >> >>> What about just keeping callback_url, and assume the /path/ >>> component >>> is a namespace? >>> >>> Shane >>> >>> On Jan 29, 2008 2:00 PM, Michael Niessner >>> wrote: >>>> I feel mixed about the name. I like that callback_path translates >>>> to >>>> the path component of your callback url. I like that >>>> sandbox_namespace >>>> signals an intention to sandbox the app using a namespace, >>>> providing >>>> guidance of how to use the setting. I prefer whichever name people >>>> would have an easier time understanding. Maybe a few others on the >>>> list could chime in? >>>> >>>> Michael Niessner >>>> >>>> >>>> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >>>> >>>>> Hi Michael, >>>>> >>>>> I agree with you about namespaces. To be clear, my example code >>>>> was >>>>> only one possible implementation. My patch is not intended to >>>>> force >>>>> sandboxing to one controller only, but rather to any namespace >>>>> desired by the developer. I would still like to keep the config >>>>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to >>>>> the Facebook callback URL setting. So to update the example: >>>>> >>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/namespace' >>>>> # where Facebook Developer callback url = http:// >>>>> yourserver.com:port/ >>>>> namespace >>>>> >>>>> Shawn >>>>> >>>>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>>>> Actually, the implementation of your patch is probably correct. >>>>>> It's >>>>>> just the intent that is all wrong. If you change >>>>>> >>>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/controller' to >>>>>> ENV['FACEBOOKER_SANDBOX_NAMESPACE'] = '/namespace' >>>>>> >>>>>> You get the benefits of multiple controllers without having to >>>>>> add a >>>>>> route for each one. Additionally you can take advantage of all >>>>>> the >>>>>> goodness that is map.resources. >>>>>> >>>>>> Also a unit test would be a nice addition to your patch. >>>>>> >>>>>> Michael Niessner >>>>>> >>>>>> >>>>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>>>> I strongly disagree. Your approach leads to the very poor design >>>>>>> decision of placing all facebook actions in a single >>>>>>> controller. By >>>>>>> using routing you can use multiple controllers in a sandboxed >>>>>>> environment. >>>>>>> >>>>>>> Set your callback_url on facebook to >>>>>>> http://yourhost.com/yourapp/sandbox/ >>>>>>> Then add the following routes >>>>>>> map.connect '/sandbox/controller_1/:action/:id', :controller => >>>>>>> 'controller_1' >>>>>>> map.connect '/sandbox/controller_2/:action/:id', :controller => >>>>>>> 'controller_2' >>>>>>> >>>>>>> I don't think adding code to facebooker to achieve a limited >>>>>>> subset >>>>>>> of the functionality that can be obtained by using rails >>>>>>> routes is >>>>>>> the "correct way" to handle this case. >>>>>>> >>>>>>> Michael Niessner >>>>>>> >>>>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>>>> The correct way to handle this case is to make sure the link >>>>>>>> URLs >>>>>>>> are composed correctly in the first place, not to add routing >>>>>>>> to >>>>>>>> resolve bad links. Facebooker already includes URL rewriting >>>>>>>> code; >>>>>>>> I've merely modified it to generate correct links for the >>>>>>>> sandbox >>>>>>>> controller case. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Shawn >>>>>>>> >>>>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>>>> Or you could do: >>>>>>>>> map.connect '/sandboxed_controller/ >>>>>>>>> sandboxed_controller/:action/:id, >>>>>>>>> :controller => 'sandboxed_controller' >>>>>>>>> where sandboxed_controller is the name of the controller you >>>>>>>>> want >>>>>>>>> to sandbox >>>>>>>>> >>>>>>>>> Michael Niessner >>>>>>>>> >>>>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>>>> >>>>>>>>>> Here's the fix for Facebook apps that specify a controller in >>>>>>>>>> their >>>>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>>>> scripts: >>>>>>>>>> >>>>>>>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/controller' >>>>>>>>>> # where controller is the name of your Facebook controller >>>>>>>>>> >>>>>>>>>> And then patch >>>>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>>>> facebook_url_rewriting.rb >>>>>>>>>> as shown in the attached diff. >>>>>>>>>> >>>>>>>>>> Please let me know if you encounter any issues with this >>>>>>>>>> patch. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Shawn >>>>>>>>>> _______________________________________________ >>>>>>>>>> Facebooker-talk mailing list >>>>>>>>>> Facebooker-talk at rubyforge.org >>>>>>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>>>>>> >>>>>>> >>>>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> >>> >>> -- >>> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From svicalifornia at gmail.com Fri Feb 1 10:08:51 2008 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Fri, 1 Feb 2008 08:08:51 -0700 Subject: [Facebooker-talk] facebook_url_rewriting.rb In-Reply-To: <1523F134-E574-46DC-B75A-A2657459BA47@yahoo.com> References: <20080128205258613970.8b92ad85@gmail.com> <92A9C88C-FA9D-4AA4-84F5-7FE714491E63@gmail.com> <20080129101945834192.5a645951@gmail.com> <8522FB7F-E88B-4D79-9C52-3FB786ACCA36@gmail.com> <20080129122045533499.e1089f89@gmail.com> <4ab757a40801291310g7c0815fejb2b10f4fd832336b@mail.gmail.com> <20080129150101916705.ebab03c9@gmail.com> <1523F134-E574-46DC-B75A-A2657459BA47@yahoo.com> Message-ID: <9284B2C0-7920-46D2-B405-507FC07141BE@gmail.com> My code has the old ENV FACEBOOKER_CALLBACK_PATH. I'll update the code in an hour. Shawn On Feb 1, 2008, at 7:40 AM, Joel Nylund wrote: > Hey guys, > > I have tested Shawn's patch on my application and it works great, > please let me know when its checked in so I can update the example > on my blog to use that approach > as its much cleaner than the way I was doing things. > > One thing you may want to add to the documentation to be clear is > that in order to work you must set your facebook callback url in > facebook > > to include the namespace with a trailing slash, a precise example: > > Namespace sandbox: > > facebook callback url - http://yoururl:yourport/namespace/ > ENV['FACEBOOKER_SANDBOX_NAMESPACE'] = '/namespace' > > thanks > Joel > > On Jan 29, 2008, at 5:01 PM, Shawn Van Ittersum wrote: > >> Works for me. Thanks, guys! >> >> Shawn >> >> On Tue, 29 Jan 2008 15:32:10 -0600, Michael Niessner wrote: >>> Shane's idea is the winner. When facebooker.yml parses callback_url >>> it can put the host component in where it currently does and stuff >>> the path into ENV['FACEBOOKER_SANDBOX_NAMESPACE']. Then developers >>> only need to copy their callback_url into callback_url of >>> facebooker.yml. >>> >>> Michael Niessner >>> >>> On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote: >>> >>>> What about just keeping callback_url, and assume the /path/ >>>> component >>>> is a namespace? >>>> >>>> Shane >>>> >>>> On Jan 29, 2008 2:00 PM, Michael Niessner >>>> wrote: >>>>> I feel mixed about the name. I like that callback_path >>>>> translates to >>>>> the path component of your callback url. I like that >>>>> sandbox_namespace >>>>> signals an intention to sandbox the app using a namespace, >>>>> providing >>>>> guidance of how to use the setting. I prefer whichever name people >>>>> would have an easier time understanding. Maybe a few others on the >>>>> list could chime in? >>>>> >>>>> Michael Niessner >>>>> >>>>> >>>>> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >>>>> >>>>>> Hi Michael, >>>>>> >>>>>> I agree with you about namespaces. To be clear, my example >>>>>> code was >>>>>> only one possible implementation. My patch is not intended to >>>>>> force >>>>>> sandboxing to one controller only, but rather to any namespace >>>>>> desired by the developer. I would still like to keep the config >>>>>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly >>>>>> to >>>>>> the Facebook callback URL setting. So to update the example: >>>>>> >>>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/namespace' >>>>>> # where Facebook Developer callback url = http:// >>>>>> yourserver.com:port/ >>>>>> namespace >>>>>> >>>>>> Shawn >>>>>> >>>>>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>>>>> Actually, the implementation of your patch is probably >>>>>>> correct. It's >>>>>>> just the intent that is all wrong. If you change >>>>>>> >>>>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/controller' to >>>>>>> ENV['FACEBOOKER_SANDBOX_NAMESPACE'] = '/namespace' >>>>>>> >>>>>>> You get the benefits of multiple controllers without having to >>>>>>> add a >>>>>>> route for each one. Additionally you can take advantage of all >>>>>>> the >>>>>>> goodness that is map.resources. >>>>>>> >>>>>>> Also a unit test would be a nice addition to your patch. >>>>>>> >>>>>>> Michael Niessner >>>>>>> >>>>>>> >>>>>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>>>>> I strongly disagree. Your approach leads to the very poor >>>>>>>> design >>>>>>>> decision of placing all facebook actions in a single >>>>>>>> controller. By >>>>>>>> using routing you can use multiple controllers in a sandboxed >>>>>>>> environment. >>>>>>>> >>>>>>>> Set your callback_url on facebook to >>>>>>>> http://yourhost.com/yourapp/sandbox/ >>>>>>>> Then add the following routes >>>>>>>> map.connect '/sandbox/controller_1/:action/:id', :controller => >>>>>>>> 'controller_1' >>>>>>>> map.connect '/sandbox/controller_2/:action/:id', :controller => >>>>>>>> 'controller_2' >>>>>>>> >>>>>>>> I don't think adding code to facebooker to achieve a limited >>>>>>>> subset >>>>>>>> of the functionality that can be obtained by using rails >>>>>>>> routes is >>>>>>>> the "correct way" to handle this case. >>>>>>>> >>>>>>>> Michael Niessner >>>>>>>> >>>>>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>>>>> The correct way to handle this case is to make sure the link >>>>>>>>> URLs >>>>>>>>> are composed correctly in the first place, not to add >>>>>>>>> routing to >>>>>>>>> resolve bad links. Facebooker already includes URL >>>>>>>>> rewriting code; >>>>>>>>> I've merely modified it to generate correct links for the >>>>>>>>> sandbox >>>>>>>>> controller case. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Shawn >>>>>>>>> >>>>>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>>>>> Or you could do: >>>>>>>>>> map.connect '/sandboxed_controller/ >>>>>>>>>> sandboxed_controller/:action/:id, >>>>>>>>>> :controller => 'sandboxed_controller' >>>>>>>>>> where sandboxed_controller is the name of the controller >>>>>>>>>> you want >>>>>>>>>> to sandbox >>>>>>>>>> >>>>>>>>>> Michael Niessner >>>>>>>>>> >>>>>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>>>>> >>>>>>>>>>> Here's the fix for Facebook apps that specify a controller >>>>>>>>>>> in >>>>>>>>>>> their >>>>>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>>>>> scripts: >>>>>>>>>>> >>>>>>>>>>> ENV['FACEBOOKER_CALLBACK_PATH'] = '/controller' >>>>>>>>>>> # where controller is the name of your Facebook controller >>>>>>>>>>> >>>>>>>>>>> And then patch >>>>>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>>>>> facebook_url_rewriting.rb >>>>>>>>>>> as shown in the attached diff. >>>>>>>>>>> >>>>>>>>>>> Please let me know if you encounter any issues with this >>>>>>>>>>> patch. >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Shawn >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Facebooker-talk mailing list >>>>>>>>>>> Facebooker-talk at rubyforge.org >>>>>>>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>>>>>>> >>>>>>>> >>>>>>> >>>>> >>>>> _______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>> >>>> >>>> >>>> >>>> -- >>>> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >>> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > From svicalifornia at gmail.com Fri Feb 1 10:40:50 2008 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Fri, 1 Feb 2008 08:40:50 -0700 Subject: [Facebooker-talk] patch Message-ID: <20080201084050820107.27332da6@gmail.com> Sorry, I won't be able to send in the right diff just yet. If you want to check in my code, just change each instance of ENV['FACEBOOKER_CALLBACK_PATH'] to ENV['FACEBOOKER_SANDBOX_NAMESPACE']. Thanks, Shawn From jnylund at yahoo.com Fri Feb 1 10:29:52 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Fri, 1 Feb 2008 10:29:52 -0500 Subject: [Facebooker-talk] proposed patch for fb_request_form_submit Message-ID: Hi, according to the Facebook docs, you can add a uid to the fb_request_form_submit button which will pre select the user for the form. So you can do: which will create a button that says "Send Fred MyApp Invitation" # helpers.rb Old code: # Create a submit button for an def fb_request_form_submit tag "fb:request-form-submit" end New code: # Create a submit button for an # options - you can pass uid & label, see http://wiki.developers.facebook.com/index.php/Fb:request-form-submit for details. def fb_request_form_submit(options={}) tag ("fb:request-form-submit",options) end Usage example: <% content_for("invite_message") do %> wants to blah blah blah. <%= fb_req_choice("Join XYZ ap",url_for(:action => "invite_signup")) %> <% end %> <% fb_request_form("MyApp","invite_message",url_for(:action => "invite_signup")) do %> <%= fb_request_form_submit({:uid => a_pre_determined_friend_id})%> <% end %> Test - This works great for my app! (note im using 1.2.6) , I have no idea how to write a test for a helper, if someone wants to show me, I will do it. thanks Joel From digidigo at gmail.com Fri Feb 1 12:45:55 2008 From: digidigo at gmail.com (David Clements) Date: Fri, 1 Feb 2008 10:45:55 -0700 Subject: [Facebooker-talk] proposed patch for fb_request_form_submit In-Reply-To: References: Message-ID: Hey Joel, If you look in rails_integration_test.rb you will see the test for that helper method. def test_fb_request_form_submit assert_equal("", at h.fb_request_form_submit) end You can add a couple of tests for the options you are adding. And also, there should be a TODO in the documentation for that method. Can you please update it with your patch? # TODO: uid and label are options on this tag. Thanks, Dave On Feb 1, 2008 8:29 AM, Joel Nylund wrote: > Hi, according to the Facebook docs, you can add a uid to the > fb_request_form_submit button which will pre select the user for the > form. > > So you can do: > > type="MyApp" content="wants to invite you to xyz app"> > > > > which will create a button that says "Send Fred MyApp Invitation" > > # helpers.rb > Old code: > # Create a submit button for an > def fb_request_form_submit > tag "fb:request-form-submit" > end > > New code: > # Create a submit button for an > # options - you can pass uid & label, see http://wiki.developers.facebook.com/index.php/Fb:request-form-submit > for details. > def fb_request_form_submit(options={}) > tag ("fb:request-form-submit",options) > end > > Usage example: > <% content_for("invite_message") do %> > wants to blah blah blah. <%= fb_req_choice("Join XYZ > ap",url_for(:action => "invite_signup")) %> > <% end %> > <% fb_request_form("MyApp","invite_message",url_for(:action => > "invite_signup")) do %> > <%= fb_request_form_submit({:uid => a_pre_determined_friend_id})%> > <% end %> > > > Test - This works great for my app! (note im using 1.2.6) , I have no > idea how to write a test for a helper, if someone wants to show me, I > will do it. > > thanks > Joel > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From fernando.correia at plainworks.com Fri Feb 1 17:31:12 2008 From: fernando.correia at plainworks.com (Fernando Correia) Date: Fri, 1 Feb 2008 20:31:12 -0200 Subject: [Facebooker-talk] Facebooker interfering with existing application Message-ID: Hi! I have an existing application, basically a very simple Hobo app. It works... When I install the Facebooker plugin and create the facebooker.yml file (with valid or fake content, doesn't matter), the original app starts behaving strangely. The controller and view logic keeps working, but several static files stop being served from http://localhost:3000/javascripts and start being searched for on http://someurl/javascripts, where someurl is the contents of the callback_url on facebooker.yml. This seems strange, because no other application file was touched: the controller, routes.rb, environment.rb, all are just as before. So, just by dropping the facebooker directory under vendor/plugins and by copying facebooker.yml to config, the app started looking for the static files on another URL. I really would like to be able to have both Hobo and Facebooker controllers and views on the same app. I also would like that the Facebooker only had some effect when I'm responding to a Facebook request, and that it left the normal Web request processing untouched. I'd appreciate if somebody can point me in the right direction. -- http://plainworks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080201/460cfce8/attachment.html From mmangino at elevatedrails.com Fri Feb 1 19:16:00 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 1 Feb 2008 18:16:00 -0600 Subject: [Facebooker-talk] Facebooker interfering with existing application In-Reply-To: References: Message-ID: You should definitely be able to have Hobo and Facebooker controllers on your same application. Does your callback url end up talking to your localhost:3000 server? If so, this shouldn't cause a problem. If it doesn't, your facebook application is misconfigured. We're working on making this integration less invasive, but we aren't there yet. Mike On Feb 1, 2008, at 4:31 PM, Fernando Correia wrote: > Hi! > > I have an existing application, basically a very simple Hobo app. It > works... > > When I install the Facebooker plugin and create the facebooker.yml > file (with valid or fake content, doesn't matter), the original app > starts behaving strangely. > > The controller and view logic keeps working, but several static > files stop being served from http://localhost:3000/javascripts and > start being searched for on http://someurl/javascripts, where > someurl is the contents of the callback_url on facebooker.yml. > > This seems strange, because no other application file was touched: > the controller, routes.rb, environment.rb, all are just as before. > > So, just by dropping the facebooker directory under vendor/plugins > and by copying facebooker.yml to config, the app started looking for > the static files on another URL. > > I really would like to be able to have both Hobo and Facebooker > controllers and views on the same app. I also would like that the > Facebooker only had some effect when I'm responding to a Facebook > request, and that it left the normal Web request processing untouched. > > I'd appreciate if somebody can point me in the right direction. > > -- > http://plainworks.com _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From mmangino at elevatedrails.com Fri Feb 1 19:27:33 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 1 Feb 2008 18:27:33 -0600 Subject: [Facebooker-talk] Facebooker and file_column In-Reply-To: References: <20080131133043322445.dbb9db98@gmail.com> Message-ID: <42BF9529-4E1A-4630-A28E-27C66415216D@elevatedrails.com> Okay, I have this working. We no longer need to set the relative url root to make Facebooker generate correct links. With this setup, javascript_include_tag and stylesheet_link_tag work correctly as long as the asset host is set. Please be careful with this release. All of the tests run, and it works on my apps, but it's a major change. You'll want to test it well before you use this in production. Mike On Jan 31, 2008, at 2:51 PM, Mike Mangino wrote: > Shawn, that's great. I think that is going to clean up a lot of our > code. The asset path patches can go away at that point. I look forward > to seeing this. > > Mike > > On Jan 31, 2008, at 2:30 PM, Shawn Van Ittersum wrote: > >> Facebooker URL Rewriter stuff overloads >> ActionController::AbstractRequest.relative_url_root, causing a >> conflict with the plugin file_column and possibly other utilities. >> file_column constructs image URLs using the server host and >> relative_url_root >> >> This is not related to the sandbox patch I added to the rewriter. >> Facebooker overloaded relative_url_root before I touched it. >> >> I've rewritten the facebooker_url_rewriting.rb script to do the same >> stuff but without overloading relative_url_root. I'll send it in >> later today. >> >> Shawn >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From jbresnik at gmail.com Sat Feb 2 06:57:21 2008 From: jbresnik at gmail.com (John Bresnik) Date: Sat, 2 Feb 2008 03:57:21 -0800 Subject: [Facebooker-talk] Question abt redirect_to.. Message-ID: <3b8cec990802020357p3b457c81g1daa164264149fc1@mail.gmail.com> I found a reference to using attachment_fu and followed the lead of it but having an issue with the redirect_to that renders the fb:render tag - In my form I'm setting the canvas to false, file is being uploaded / save fine but when I attempt to redirect: redirect_to :action => :new, :canvas => true Unfortunatly it looks like my callback URL is getting printed twice, e.g. http://myserver.com/my_action/my_action/new I suppose I could write a helper to pull it out but there's probably a better way.. Any thoughts? Thanks From mmangino at elevatedrails.com Sat Feb 2 17:44:33 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Sat, 2 Feb 2008 16:44:33 -0600 Subject: [Facebooker-talk] Facebooker interfering with existing application In-Reply-To: References: Message-ID: Try upgrading to the newest facebooker. Those problems should now be fixed. Mike On Feb 2, 2008, at 12:03 PM, Fernando Correia wrote: > On Feb 1, 2008 10:16 PM, Mike Mangino > wrote: >> You should definitely be able to have Hobo and Facebooker controllers >> on your same application. Does your callback url end up talking to >> your localhost:3000 server? If so, this shouldn't cause a problem. If >> it doesn't, your facebook application is misconfigured. > > I appreciate your help. Now I understand that the Facebooker plugin > will affect all URLs of my app, not just those of Facebook > controllers. > > But I still don't understand how I can set up the callback_url and > canvas_page_name configuration items so the previous controllers and > views can keep working and at the same time a new Facebook controller > can also work. > > I'd like to have a http://myurl/facebooker controller, where the > Facebook functionality is, and other controllers like > http://myurl/collections, where my normal app functionality is. > > Please advise. > > Details of my experience below: > > URLs of the working application, without Facebooker: > > 1a. http://localhost:3000/stylesheets/reset.css > 2a. http://localhost:3000/hobothemes/clean/stylesheets/application.css > 3a. http://localhost:3000/javascripts/prototype.js?1201903010 > 4a. http://localhost:3000/hobothemes/clean/images/spinner.gif > 5a. http://localhost:3000/collections/1 > > URLs after facebooker directory and facebooker.yml file are copied: > > 1b. http://localhost:3000/CANVASPAGENAME/stylesheets/reset.css [1] > 2b. http://localhost:3000/CANVASPAGENAME/hobothemes/clean/stylesheets/application.css > [1] > 3b. http://callbackurl/javascripts/prototype.js [2] > 4b. http://localhost:3000/CANVASPAGENAME/hobothemes/clean/images/spinner.gif > [1] > 5b. http://localhost:3000/CANVASPAGENAME/collections/1 [1] > > Patterns: > > [1] CANVASPAGENAME is appended to the base URL. > [2] The base URL is substituted for the callback URL. > > I can deal with the callback, but I really don't know how to adjust > for the modification involving the canvas page name on so many URLs. > > routes.rb: > > ActionController::Routing::Routes.draw do |map| > # map.facebook_root > '', :controller=>'facebook', :conditions=>{:canvas=>true} > map.search 'search', :controller => 'front', :action => 'search' > map.homepage '', :controller => 'front', :action => 'index' > Hobo.add_routes(map) > map.connect ':controller/:action/:id' > map.connect ':controller/:action/:id.:format' > end > > facebooker.yml: > > development: > api_key: **************************** > secret_key: **************************** > canvas_page_name: CANVASPAGENAME > callback_url: http://CALLBACKURL/ -- Mike Mangino http://www.elevatedrails.com From nick.hegde at gmail.com Sun Feb 3 09:24:12 2008 From: nick.hegde at gmail.com (Nick) Date: Sun, 3 Feb 2008 22:24:12 +0800 Subject: [Facebooker-talk] no such file to load -- net/http_multipart_post Message-ID: <333d70b10802030624l213092dbxfed093da40c19f0e@mail.gmail.com> Hi, I installed Facebooker as a plugin. when I tried to start mongrel, I got this error: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- net/http_multipart_post (MissingSourceFile) I gather from previous messages posted here that 'net/http_multipart_post' is a new library that allows to upload photos to facebook. However there was no conclusion on this, so decided to post it again. I tried running: require 'net/http_multipart_post' on irb, it reports the same error as well. However the error goes away when I build the gem and install it as stipulated here: http://rfacebook.wordpress.com/2008/01/05/desktop/ . But Facebooker is supposed to work by installing it as a plugin alone rite? In the meantime working on it by commenting out line 1 from: /vendor/plugins/facebooker/init.rb Thank you! Nik -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080203/53d84465/attachment.html From jnylund at yahoo.com Sun Feb 3 09:44:14 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Sun, 3 Feb 2008 06:44:14 -0800 (PST) Subject: [Facebooker-talk] no such file to load -- net/http_multipart_post Message-ID: <32559.89019.qm@web50604.mail.re2.yahoo.com> Hey Nick, the bug is in the plugin install script, for some reason its not copying over the file in the net directory under this plugin, if anyone understands how plugins work beter than I do im sure we can fix it, to fix for now do: comment out the first line in init (as long as you dont need to do big files) or checkout the code from svn and then copy the file in the net folder over to your vendor/plugins directory manually (the folder was there for me) Joel ----- Original Message ---- From: Nick To: facebooker-talk at rubyforge.org Sent: Sunday, February 3, 2008 9:24:12 AM Subject: [Facebooker-talk] no such file to load -- net/http_multipart_post Hi, I installed Facebooker as a plugin. when I tried to start mongrel, I got this error: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- net/http_multipart_post (MissingSourceFile) I gather from previous messages posted here that 'net/http_multipart_post' is a new library that allows to upload photos to facebook. However there was no conclusion on this, so decided to post it again. I tried running: require 'net/http_multipart_post' on irb, it reports the same error as well. However the error goes away when I build the gem and install it as stipulated here: http://rfacebook.wordpress.com/2008/01/05/desktop/ . But Facebooker is supposed to work by installing it as a plugin alone rite? In the meantime working on it by commenting out line 1 from: /vendor/plugins/facebooker/init.rb Thank you! Nik -----Inline Attachment Follows----- _______________________________________________ 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/20080203/629b8202/attachment-0001.html From nick.hegde at gmail.com Sun Feb 3 10:31:30 2008 From: nick.hegde at gmail.com (Nick) Date: Sun, 3 Feb 2008 23:31:30 +0800 Subject: [Facebooker-talk] no such file to load -- net/http_multipart_post In-Reply-To: <32559.89019.qm@web50604.mail.re2.yahoo.com> References: <32559.89019.qm@web50604.mail.re2.yahoo.com> Message-ID: <333d70b10802030731p1e945320wa303a45d2c4f9e40@mail.gmail.com> cool! Thanks Joel! thanks for the Facebooker Quick Start ( http://jnylund.typepad.com/joels_blog/2008/01/facebooker-gett.html) too! On Feb 3, 2008 10:44 PM, Joel Nylund wrote: > Hey Nick, the bug is in the plugin install script, for some reason its not > copying over the file in the net directory under this plugin, if anyone > understands how plugins work beter than I do im sure we can fix it, to fix > for now do: > > comment out the first line in init (as long as you dont need to do big > files) > or > checkout the code from svn and then copy the file in the net folder over > to your vendor/plugins directory manually (the folder was there for me) > > > Joel > > > > ----- Original Message ---- > From: Nick > To: facebooker-talk at rubyforge.org > Sent: Sunday, February 3, 2008 9:24:12 AM > Subject: [Facebooker-talk] no such file to load -- net/http_multipart_post > > Hi, > > I installed Facebooker as a plugin. > > when I tried to start mongrel, I got this > error: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- net/http_multipart_post > (MissingSourceFile) > > I gather from previous messages posted here that > 'net/http_multipart_post' is a new library that allows to upload photos to > facebook. However there was no conclusion on this, so decided to post it > again. > > I tried running: require 'net/http_multipart_post' on irb, it reports the > same error as well. > > However the error goes away when I build the gem and install it as > stipulated here: http://rfacebook.wordpress.com/2008/01/05/desktop/ . But > Facebooker is supposed to work by installing it as a plugin alone rite? > > In the meantime working on it by commenting out line 1 > from: /vendor/plugins/facebooker/init.rb > > Thank you! > > Nik > > > -----Inline Attachment Follows----- > > _______________________________________________ > 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/20080203/3485bf8f/attachment.html From nick.hegde at gmail.com Sun Feb 3 11:23:26 2008 From: nick.hegde at gmail.com (Nick) Date: Mon, 4 Feb 2008 00:23:26 +0800 Subject: [Facebooker-talk] undefined method `path_prefix' for Facebooker:Module Message-ID: <333d70b10802030823v77d77cf5x9063cbae204c5861@mail.gmail.com> Does anyone encounter this 'NoMethodError' ? its coming from: ( /vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb:4:in `relative_url_root' ) Line 4 of facebook_url_rewriting.rb : Facebooker.path_prefix using the later version of Facebooker, installed as a plugin. Thank you! Nik -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080204/7d3a2f05/attachment.html From jnylund at yahoo.com Sun Feb 3 13:25:53 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Sun, 3 Feb 2008 13:25:53 -0500 Subject: [Facebooker-talk] undefined method `path_prefix' for Facebooker:Module In-Reply-To: <333d70b10802030823v77d77cf5x9063cbae204c5861@mail.gmail.com> References: <333d70b10802030823v77d77cf5x9063cbae204c5861@mail.gmail.com> Message-ID: <9D794777-A36A-4D50-B2A9-1F7744C1B48A@yahoo.com> Hey Nick, do yo have callback_url defined in your facebooker.yml ? if not, try that and see if it goes away, if it doesn't, its probably a new issue. thanks joel On Feb 3, 2008, at 11:23 AM, Nick wrote: > Does anyone encounter this 'NoMethodError' ? > > its coming from: ( /vendor/plugins/facebooker/lib/facebooker/rails/ > facebook_url_rewriting.rb:4:in `relative_url_root' ) > > Line 4 of facebook_url_rewriting.rb : Facebooker.path_prefix > > using the later version of Facebooker, installed as a plugin. > > Thank you! > > Nik > _______________________________________________ > 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/20080203/e90785d8/attachment.html From geraldbauer2007 at gmail.com Sun Feb 3 23:57:34 2008 From: geraldbauer2007 at gmail.com (Gerald Bauer) Date: Sun, 3 Feb 2008 20:57:34 -0800 Subject: [Facebooker-talk] 10-Minute Quick Start Guide for Facebooker - Create a Facebook App Using Rails in 7 Easy Steps Message-ID: <7e7cb8940802032057s2329fcd3h23c46da8b6333e5f@mail.gmail.com> Hello, FYI: I've published a Facebooker version of the Quick Start Guide that creates a Twitter-style message using the Facebook API on the "facebook for ruby // questions & answers / news / discussions / more" site. Full article @ http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/ Cheers. -- Gerald Bauer - Internet Professional - http://geraldbauer.wordpress.com From nick.hegde at gmail.com Mon Feb 4 01:59:42 2008 From: nick.hegde at gmail.com (Nick) Date: Mon, 4 Feb 2008 14:59:42 +0800 Subject: [Facebooker-talk] undefined method `path_prefix' for Facebooker:Module In-Reply-To: <9D794777-A36A-4D50-B2A9-1F7744C1B48A@yahoo.com> References: <333d70b10802030823v77d77cf5x9063cbae204c5861@mail.gmail.com> <9D794777-A36A-4D50-B2A9-1F7744C1B48A@yahoo.com> Message-ID: <333d70b10802032259n14de24cdx978c2c1f6342aa46@mail.gmail.com> Hi Joel, Yup, I do have have the callback_url defined in my facebooker.yml, its ' http://localhost:3000' This seems to be caused by the line 4: in the ruby file: vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb it says: Facebooker.path_prefix Do you have this line in your "facebook_url_rewriting.rb" as well? If not it might be something new, or the method "path_prefix" might not have loaded properly :( -Nik On Feb 4, 2008 2:25 AM, Joel Nylund wrote: > Hey Nick, do yo have callback_url defined in your facebooker.yml ? > if not, try that and see if it goes away, if it doesn't, its probably a > new issue. > > thanks > joel > > On Feb 3, 2008, at 11:23 AM, Nick wrote: > > Does anyone encounter this 'NoMethodError' ? > its coming from: ( /vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb:4:in > `relative_url_root' ) > > Line 4 of facebook_url_rewriting.rb : Facebooker.path_prefix > > using the later version of Facebooker, installed as a plugin. > > Thank you! > > Nik > _______________________________________________ > 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/20080204/11881e94/attachment.html From jbresnik at gmail.com Mon Feb 4 14:38:24 2008 From: jbresnik at gmail.com (John Bresnik) Date: Mon, 4 Feb 2008 11:38:24 -0800 Subject: [Facebooker-talk] Question abt redirect_to.. In-Reply-To: <3b8cec990802020357p3b457c81g1daa164264149fc1@mail.gmail.com> References: <3b8cec990802020357p3b457c81g1daa164264149fc1@mail.gmail.com> Message-ID: <3b8cec990802041138j31af43f0y3bb16e64b65bd0a8@mail.gmail.com> Some updates on this - using the new debug features in 2.0 [very nice btw] I managed to determine that in the ~/rails/controller.rb the code is *not dropping into fbml_redirect_tag [request_is_for_a_facebook_canvas? returns false] and is instead getting sent to the super [the rails controller I'm assuming] - so yea basically stuck - can anybody provide any hints as to where I should be looking in the code? Or even a description of the difference between :canvas => true and :canvas => :false in facebooker terms.. Thanks! On Feb 2, 2008 3:57 AM, John Bresnik wrote: > I found a reference to using attachment_fu and followed the lead of it > but having an issue with the redirect_to that renders the fb:render > tag - In my form I'm setting the canvas to false, file is being > uploaded / save fine but when I attempt to redirect: > > redirect_to :action => :new, :canvas => true > > Unfortunatly it looks like my callback URL is getting printed twice, e.g. > > http://myserver.com/my_action/my_action/new > > I suppose I could write a helper to pull it out but there's probably a > better way.. Any thoughts? > > Thanks > From jnylund at yahoo.com Mon Feb 4 16:59:15 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Mon, 4 Feb 2008 16:59:15 -0500 Subject: [Facebooker-talk] proposed patch for fb_request_form_submit In-Reply-To: References: Message-ID: Ok, here are the tests and updated rdoc # Create a submit button for an # If the request is for an individual user you can optionally # Provide the user and a label for the request button. # For example # <% content_for("invite_user") do %> # This gets sent in the invite. <%= fb_req_choice("Come join us!","new_invite_path") %> # <% end %> # <% fb_request_form("Invite","invite_user","create_invite_path") do %> # Invite <%= fb_name(@facebook_user.friends.first.id)%> to the party
# <%= fb_request_form_submit(@facebook_user.friends.first.id, "Invite %n") %> # <% end %> # See: http://wiki.developers.facebook.com/index.php/Fb:request-form-submit for options def fb_request_form_submit(options={}) tag("fb:request-form-submit",options) end ************************************************* Tests: def test_fb_request_form_submit_with_uid assert_equal("", at h.fb_request_form_submit({:uid => "123456789"})) end def test_fb_request_form_submit_with_label assert_equal("", at h.fb_request_form_submit({:label => "Send Invite to Joel"})) end def test_fb_request_form_submit_with_uid_and_label assert_equal("", at h.fb_request_form_submit({:uid => "123456789", :label => "Send Invite to Joel"})) end thanks Joel On Feb 1, 2008, at 12:45 PM, David Clements wrote: > Hey Joel, > > If you look in rails_integration_test.rb you will see the test for > that helper method. > > def test_fb_request_form_submit > assert_equal(" >", at h.fb_request_form_submit) > end > > You can add a couple of tests for the options you are adding. > > And also, there should be a TODO in the documentation for that method. > Can you please update it with your patch? > > # TODO: uid and label are options on this tag. > > > Thanks, > > Dave > > > On Feb 1, 2008 8:29 AM, Joel Nylund wrote: >> Hi, according to the Facebook docs, you can add a uid to the >> fb_request_form_submit button which will pre select the user for the >> form. >> >> So you can do: >> >> > type="MyApp" content="wants to invite you to xyz app"> >> >> >> >> which will create a button that says "Send Fred MyApp Invitation" >> >> # helpers.rb >> Old code: >> # Create a submit button for an >> def fb_request_form_submit >> tag "fb:request-form-submit" >> end >> >> New code: >> # Create a submit button for an >> # options - you can pass uid & label, see http://wiki.developers.facebook.com/index.php/Fb:request-form-submit >> for details. >> def fb_request_form_submit(options={}) >> tag ("fb:request-form-submit",options) >> end >> >> Usage example: >> <% content_for("invite_message") do %> >> wants to blah blah blah. <%= fb_req_choice("Join XYZ >> ap",url_for(:action => "invite_signup")) %> >> <% end %> >> <% fb_request_form("MyApp","invite_message",url_for(:action => >> "invite_signup")) do %> >> <%= fb_request_form_submit({:uid => a_pre_determined_friend_id}) >> %> >> <% end %> >> >> >> Test - This works great for my app! (note im using 1.2.6) , I have >> no >> idea how to write a test for a helper, if someone wants to show me, I >> will do it. >> >> thanks >> Joel >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> From mniessner at elevatedrails.com Tue Feb 5 12:04:00 2008 From: mniessner at elevatedrails.com (Michael Niessner) Date: Tue, 5 Feb 2008 11:04:00 -0600 Subject: [Facebooker-talk] Question abt redirect_to.. In-Reply-To: <3b8cec990802041138j31af43f0y3bb16e64b65bd0a8@mail.gmail.com> References: <3b8cec990802020357p3b457c81g1daa164264149fc1@mail.gmail.com> <3b8cec990802041138j31af43f0y3bb16e64b65bd0a8@mail.gmail.com> Message-ID: If in the form you are setting :canvas => false then you would not want to render an fbml_redirect_tag. Rendering an fbml_redirect tag would be send fbml directly to the user's browser. I'm not sure why it is including my_action twice in the url. Is my_action the name of a controller? It seems like new is probably the action. What does your facebooker.yml look like? What revision of facebooker are you using? Michael On Feb 4, 2008, at 1:38 PM, John Bresnik wrote: > Some updates on this - using the new debug features in 2.0 [very nice > btw] I managed to determine that in the ~/rails/controller.rb the code > is *not dropping into fbml_redirect_tag > [request_is_for_a_facebook_canvas? returns false] and is instead > getting sent to the super [the rails controller I'm assuming] - so yea > basically stuck - can anybody provide any hints as to where I should > be looking in the code? Or even a description of the difference > between :canvas => true and :canvas => :false in facebooker terms.. > Thanks! > > > On Feb 2, 2008 3:57 AM, John Bresnik wrote: >> I found a reference to using attachment_fu and followed the lead of >> it >> but having an issue with the redirect_to that renders the fb:render >> tag - In my form I'm setting the canvas to false, file is being >> uploaded / save fine but when I attempt to redirect: >> >> redirect_to :action => :new, :canvas => true >> >> Unfortunatly it looks like my callback URL is getting printed >> twice, e.g. >> >> http://myserver.com/my_action/my_action/new >> >> I suppose I could write a helper to pull it out but there's >> probably a >> better way.. Any thoughts? >> >> Thanks >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From jnylund at yahoo.com Tue Feb 5 15:04:12 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Tue, 5 Feb 2008 15:04:12 -0500 Subject: [Facebooker-talk] presenting validation errors via fbml? In-Reply-To: <4ab757a40801311130s2747bb8fh12f9557903028959@mail.gmail.com> References: <13F08D5D-C9C2-4094-8B9B-E7FC64030EF1@yahoo.com> <4ab757a40801311130s2747bb8fh12f9557903028959@mail.gmail.com> Message-ID: <0FD2960D-CBDA-497D-9A2A-647E90F40742@yahoo.com> Hi, I tend to use error_messages_for so I wrote a helper: fbml_error_messages_for, that puts the right facebook tags in there & formats them somewhat nicely. Let me know if you think others would like this and I can create some testcases so you can add it, otherwise I will just leave in my helper. Note, the rails helper changed form 1.2 to 2, I hacked up the 1.2 one to get this, I think it will work just fine on 2 but not sure. thanks Joel def fbml_error_messages_for(*params) logger.debug "facehelper version being called" options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {} objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact count = objects.inject(0) {|sum, object| sum + object.errors.count } unless count.zero? html = {} [:id, :class].each do |key| if options.include?(key) value = options[key] html[key] = value unless value.blank? else html[key] = 'errorExplanation' end end header_message = "#{pluralize(count, 'error')} prohibited this #{(options[:object_name] || params.first).to_s.gsub('_', ' ')} from being saved" error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } } content_tag('fb:error', content_tag('fb:message', header_message) << content_tag(:p, 'There were problems with the following fields:') << content_tag(:ul, error_messages, :style => 'font-size:12px;'), html ) else '' end end On Jan 31, 2008, at 2:30 PM, Shane Vitarana wrote: > Joel- Just wrap your flash[:error] inside an fb_error helper. Or put > <%= facebook_messages %> in your layout. > > Shane > > On Jan 31, 2008 10:14 AM, Joel Nylund wrote: >> Hi Facebookers, >> >> Is there a helper or suggested approach for presenting validation >> errors on an fbml form? >> >> Something to translate rails error markup to fbml:error markup? >> >> thanks >> Joel >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > > -- > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com From shanev at gmail.com Tue Feb 5 16:15:28 2008 From: shanev at gmail.com (Shane Vitarana) Date: Tue, 5 Feb 2008 15:15:28 -0600 Subject: [Facebooker-talk] presenting validation errors via fbml? In-Reply-To: <0FD2960D-CBDA-497D-9A2A-647E90F40742@yahoo.com> References: <13F08D5D-C9C2-4094-8B9B-E7FC64030EF1@yahoo.com> <4ab757a40801311130s2747bb8fh12f9557903028959@mail.gmail.com> <0FD2960D-CBDA-497D-9A2A-647E90F40742@yahoo.com> Message-ID: <4ab757a40802051315u76f9651cl1387b8c7577cd30f@mail.gmail.com> Joel- This is great. Can you re-use the existing fb status helpers instead of the custom content tags? If you include a test, and send it as a patch to Rubyforge , I'll add it in with attribution. Thanks, Shane On Feb 5, 2008 2:04 PM, Joel Nylund wrote: > Hi, > > I tend to use > > error_messages_for > > so I wrote a helper: > > fbml_error_messages_for, that puts the right facebook tags in there & > formats them somewhat nicely. > > Let me know if you think others would like this and I can create some > testcases so you can add it, otherwise I will just leave in my helper. > > Note, the rails helper changed form 1.2 to 2, I hacked up the 1.2 one > to get this, I think it will work just fine on 2 but not sure. > > thanks > Joel > > > > def fbml_error_messages_for(*params) > logger.debug "facehelper version being called" > options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {} > objects = params.collect {|object_name| > instance_variable_get("@#{object_name}") }.compact > count = objects.inject(0) {|sum, object| sum + > object.errors.count } > unless count.zero? > html = {} > [:id, :class].each do |key| > if options.include?(key) > value = options[key] > html[key] = value unless value.blank? > else > html[key] = 'errorExplanation' > end > end > header_message = "#{pluralize(count, 'error')} prohibited this > #{(options[:object_name] || params.first).to_s.gsub('_', ' ')} from > being saved" > error_messages = objects.map {|object| > object.errors.full_messages.map {|msg| content_tag(:li, msg) } } > content_tag('fb:error', > content_tag('fb:message', header_message) << > content_tag(:p, 'There were problems with the following > fields:') << > content_tag(:ul, error_messages, :style => 'font-size:12px;'), > html > ) > else > '' > end > end > > > > > On Jan 31, 2008, at 2:30 PM, Shane Vitarana wrote: > > > Joel- Just wrap your flash[:error] inside an fb_error helper. Or put > > <%= facebook_messages %> in your layout. > > > > Shane > > > > On Jan 31, 2008 10:14 AM, Joel Nylund wrote: > >> Hi Facebookers, > >> > >> Is there a helper or suggested approach for presenting validation > >> errors on an fbml form? > >> > >> Something to translate rails error markup to fbml:error markup? > >> > >> thanks > >> Joel > >> > >> _______________________________________________ > >> Facebooker-talk mailing list > >> Facebooker-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/facebooker-talk > >> > > > > > > > > -- > > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com > > -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com From jbresnik at gmail.com Tue Feb 5 16:50:01 2008 From: jbresnik at gmail.com (John Bresnik) Date: Tue, 5 Feb 2008 13:50:01 -0800 Subject: [Facebooker-talk] Question abt redirect_to.. In-Reply-To: <3b8cec990802041138j31af43f0y3bb16e64b65bd0a8@mail.gmail.com> References: <3b8cec990802020357p3b457c81g1daa164264149fc1@mail.gmail.com> <3b8cec990802041138j31af43f0y3bb16e64b65bd0a8@mail.gmail.com> Message-ID: <3b8cec990802051350s7461d58ajf333867aa98a8abf@mail.gmail.com> For the archives - Mike suggested not using a path in the callback URL - that seemed to do it.. Thanks Mike! On Feb 4, 2008 11:38 AM, John Bresnik wrote: > Some updates on this - using the new debug features in 2.0 [very nice > btw] I managed to determine that in the ~/rails/controller.rb the code > is *not dropping into fbml_redirect_tag > [request_is_for_a_facebook_canvas? returns false] and is instead > getting sent to the super [the rails controller I'm assuming] - so yea > basically stuck - can anybody provide any hints as to where I should > be looking in the code? Or even a description of the difference > between :canvas => true and :canvas => :false in facebooker terms.. > Thanks! > > > > On Feb 2, 2008 3:57 AM, John Bresnik wrote: > > I found a reference to using attachment_fu and followed the lead of it > > but having an issue with the redirect_to that renders the fb:render > > tag - In my form I'm setting the canvas to false, file is being > > uploaded / save fine but when I attempt to redirect: > > > > redirect_to :action => :new, :canvas => true > > > > Unfortunatly it looks like my callback URL is getting printed twice, e.g. > > > > http://myserver.com/my_action/my_action/new > > > > I suppose I could write a helper to pull it out but there's probably a > > better way.. Any thoughts? > > > > Thanks > > > From bjclark at scidept.com Tue Feb 5 16:54:28 2008 From: bjclark at scidept.com (BJ Clark) Date: Tue, 5 Feb 2008 14:54:28 -0700 Subject: [Facebooker-talk] Built-In Bebo Support Message-ID: <1427CA51-BA9B-4B80-B176-6862E480D030@scidept.com> Seeing as how Bebo's platform is so close to Facebook's, it makes sense to me to build in Bebo support to Facebooker. Is anyone working on this yet and would you guys be open to accepting patches for this? Or should I start a bebo specific sub project, or. . . Thanks, BJ ----- BJ Clark the science department bjclark at scidept.com www.scidept.com From jnylund at yahoo.com Tue Feb 5 20:52:01 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Tue, 5 Feb 2008 20:52:01 -0500 Subject: [Facebooker-talk] how to post to a friends news feed using facebooker Message-ID: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> Hi, I can post to my news feed using: # publish to my feed (userF = my facebook user) @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = 'joels story title'; s.body = 'joels crazy body'; s)) # publish to a friends feed (@fsession = my facebook session) fred_user = Facebooker::User.new(7779966751, at fsession) fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = 'joels just did blah blah'; s.body = 'joels crazy body'; s)) When I do this, I get 2 stories in my feed and none in my friends feed. any ideas? I have seen the news about requiring a session to post to a feed, but I thought you could still post to your friends feeds (just not your friends friends). thanks Joel From jbresnik at gmail.com Tue Feb 5 21:11:57 2008 From: jbresnik at gmail.com (John Bresnik) Date: Tue, 5 Feb 2008 18:11:57 -0800 Subject: [Facebooker-talk] how to post to a friends news feed using facebooker In-Reply-To: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> References: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> Message-ID: <3b8cec990802051811q38ca1af3i624fffa999f9baa5@mail.gmail.com> Seem to recall that publishStory only sends to the current logged in user: http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser i.e. can't really send to Fred that way - I think what you really want to use is publish_action ? also assumes that Fred is both your friend and has the app installed.. TemplatizedAction will send to all friends but its abt to be depreciated.. Not sure why youre gettn two of them tho.. probably a side effect of what youre trying do.. brez On Feb 5, 2008 5:52 PM, Joel Nylund wrote: > Hi, I can post to my news feed using: > > # publish to my feed (userF = my facebook user) > @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = > 'joels story title'; s.body = 'joels crazy body'; s)) > > # publish to a friends feed (@fsession = my facebook session) > fred_user = Facebooker::User.new(7779966751, at fsession) > fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = > 'joels just did blah blah'; s.body = 'joels crazy body'; s)) > > When I do this, I get 2 stories in my feed and none in my friends feed. > > any ideas? > > I have seen the news about requiring a session to post to a feed, but > I thought you could still post to your friends feeds (just not your > friends friends). > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From bjclark at scidept.com Tue Feb 5 21:23:25 2008 From: bjclark at scidept.com (BJ Clark) Date: Tue, 5 Feb 2008 19:23:25 -0700 Subject: [Facebooker-talk] how to post to a friends news feed using facebooker In-Reply-To: <3b8cec990802051811q38ca1af3i624fffa999f9baa5@mail.gmail.com> References: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> <3b8cec990802051811q38ca1af3i624fffa999f9baa5@mail.gmail.com> Message-ID: <51879118-A030-41C4-9CB7-81AD23DD4425@scidept.com> Joel, You have to use the "fake session" technique. This is the method I use to create the session: def fake_session session = Facebooker::Session.create session.secure_with! self.facebook_session_key, self.facebook_uid, 0 session end The facebook_session_key is the user's (who you're publishing to) infinite session key. Then, any methods you call on this session look like you're calling them from the other user, instead of the current user doing the action. Now, having said that, I'm guessing you're actually looking to use http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction . This lets you do something like "{actor} did something to {target}" and just specify the actor's id and any number of target ids. Hope that helps, BJ ----- BJ Clark the science department bjclark at scidept.com www.scidept.com On Feb 5, 2008, at 7:11 PM, John Bresnik wrote: > Seem to recall that publishStory only sends to the current logged in > user: > > http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser > > i.e. can't really send to Fred that way - I think what you really want > to use is publish_action ? > > also assumes that Fred is both your friend and has the app installed.. > TemplatizedAction will send to all friends but its abt to be > depreciated.. > > Not sure why youre gettn two of them tho.. probably a side effect of > what youre trying do.. > > brez > > > On Feb 5, 2008 5:52 PM, Joel Nylund wrote: >> Hi, I can post to my news feed using: >> >> # publish to my feed (userF = my facebook user) >> @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = >> 'joels story title'; s.body = 'joels crazy body'; s)) >> >> # publish to a friends feed (@fsession = my facebook session) >> fred_user = Facebooker::User.new(7779966751, at fsession) >> fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = >> 'joels just did blah blah'; s.body = 'joels crazy body'; s)) >> >> When I do this, I get 2 stories in my feed and none in my friends >> feed. >> >> any ideas? >> >> I have seen the news about requiring a session to post to a feed, but >> I thought you could still post to your friends feeds (just not your >> friends friends). >> >> thanks >> Joel >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > _______________________________________________ > 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/20080205/d237adc5/attachment-0001.html From jnylund at yahoo.com Tue Feb 5 21:53:11 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Tue, 5 Feb 2008 21:53:11 -0500 Subject: [Facebooker-talk] how to post to a friends news feed using facebooker In-Reply-To: <51879118-A030-41C4-9CB7-81AD23DD4425@scidept.com> References: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> <3b8cec990802051811q38ca1af3i624fffa999f9baa5@mail.gmail.com> <51879118-A030-41C4-9CB7-81AD23DD4425@scidept.com> Message-ID: <8E16702B-E975-450C-9848-8A780E9C494C@yahoo.com> Thanks BJ & John, couple more questions, Is TemplatizedAction really going away or just requiring a valid session (or fake one as BJ has outlined how to do)? see http://developers.facebook.com/news.php?blog=1&story=69 So given that, if I have a valid user that is logged in to generate a story in all their friends feeds, I don't need a fake session right? I only need this if im trying to generate news from a backend process that doesnt have a valid logged in user right? So would this work (assuming I have a valid logged in user @userF: (@userF is the current facebook user) action = Facebooker::Feed::TemplatizedAction.new action.actor_id = @userF.id action.title_template = "test from {actor} did something" action.target_ids = "comma seperated list of friend ids" @userF.publish_templatized_action(action) I got a response code of 1 for this but dont see the story in my friends account, is there a delay in posting stories? Is there a safety setting or something that if your app is not in production it will not let you post to others feeds? thanks Joel On Feb 5, 2008, at 9:23 PM, BJ Clark wrote: > Joel, > You have to use the "fake session" technique. > > This is the method I use to create the session: > def fake_session > session = Facebooker::Session.create > session.secure_with! self.facebook_session_key, > self.facebook_uid, 0 > session > end > > The facebook_session_key is the user's (who you're publishing to) > infinite session key. > > Then, any methods you call on this session look like you're calling > them from the other user, instead of the current user doing the > action. > > Now, having said that, I'm guessing you're actually looking to use http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction > . > This lets you do something like "{actor} did something to {target}" > and just specify the actor's id and any number of target ids. > > Hope that helps, > BJ > > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Feb 5, 2008, at 7:11 PM, John Bresnik wrote: > >> Seem to recall that publishStory only sends to the current logged >> in user: >> >> http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser >> >> i.e. can't really send to Fred that way - I think what you really >> want >> to use is publish_action ? >> >> also assumes that Fred is both your friend and has the app >> installed.. >> TemplatizedAction will send to all friends but its abt to be >> depreciated.. >> >> Not sure why youre gettn two of them tho.. probably a side effect of >> what youre trying do.. >> >> brez >> >> >> On Feb 5, 2008 5:52 PM, Joel Nylund wrote: >>> Hi, I can post to my news feed using: >>> >>> # publish to my feed (userF = my facebook user) >>> @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = >>> 'joels story title'; s.body = 'joels crazy body'; s)) >>> >>> # publish to a friends feed (@fsession = my facebook session) >>> fred_user = Facebooker::User.new(7779966751, at fsession) >>> fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = >>> 'joels just did blah blah'; s.body = 'joels crazy body'; s)) >>> >>> When I do this, I get 2 stories in my feed and none in my friends >>> feed. >>> >>> any ideas? >>> >>> I have seen the news about requiring a session to post to a feed, >>> but >>> I thought you could still post to your friends feeds (just not your >>> friends friends). >>> >>> thanks >>> Joel >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > 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/20080205/5e9c1828/attachment.html From shanev at gmail.com Tue Feb 5 22:44:49 2008 From: shanev at gmail.com (Shane Vitarana) Date: Tue, 5 Feb 2008 21:44:49 -0600 Subject: [Facebooker-talk] how to post to a friends news feed using facebooker In-Reply-To: <8E16702B-E975-450C-9848-8A780E9C494C@yahoo.com> References: <38E73817-EE40-4B6C-89C2-C423F517C533@yahoo.com> <3b8cec990802051811q38ca1af3i624fffa999f9baa5@mail.gmail.com> <51879118-A030-41C4-9CB7-81AD23DD4425@scidept.com> <8E16702B-E975-450C-9848-8A780E9C494C@yahoo.com> Message-ID: <4ab757a40802051944w4dddfb7cw73188a8705540cc3@mail.gmail.com> Publish templatized feed isn't going away, but publish action of user might since the templatized call makes it redundant. Facebook changed the rules so that only logged in active users can publish feeds. So you cannot publish it at a later time using someone else's session key. Also, the actor_id parameter isn't needed anymore. You still need to put {actor} somewhere in your title template though. Facebook will populate {actor} using the user who the session_key belongs to. Shane On Feb 5, 2008 8:53 PM, Joel Nylund wrote: > Thanks BJ & John, > > couple more questions, > > Is TemplatizedAction really going away or just requiring a valid session (or > fake one as BJ has outlined how to do)? > > see http://developers.facebook.com/news.php?blog=1&story=69 > > So given that, if I have a valid user that is logged in to generate a story > in all their friends feeds, I don't need a fake session right? I only need > this if im trying to generate news from a backend process that doesnt have a > valid logged in user right? > > So would this work (assuming I have a valid logged in user @userF: > > (@userF is the current facebook user) > action = Facebooker::Feed::TemplatizedAction.new > action.actor_id = @userF.id > action.title_template = "test from {actor} did something" > action.target_ids = "comma seperated list of friend ids" > @userF.publish_templatized_action(action) > > I got a response code of 1 for this but dont see the story in my friends > account, is there a delay in posting stories? > > Is there a safety setting or something that if your app is not in production > it will not let you post to others feeds? > > thanks > Joel > > > > > > > On Feb 5, 2008, at 9:23 PM, BJ Clark wrote: > > Joel, > You have to use the "fake session" technique. > > This is the method I use to create the session: > def fake_session > session = Facebooker::Session.create > session.secure_with! self.facebook_session_key, self.facebook_uid, 0 > session > end > > The facebook_session_key is the user's (who you're publishing to) infinite > session key. > > Then, any methods you call on this session look like you're calling them > from the other user, instead of the current user doing the action. > > Now, having said that, I'm guessing you're actually looking to use > http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction. > This lets you do something like "{actor} did something to {target}" and just > specify the actor's id and any number of target ids. > > Hope that helps, > BJ > > > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Feb 5, 2008, at 7:11 PM, John Bresnik wrote: > > Seem to recall that publishStory only sends to the current logged in user: > > http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser > > i.e. can't really send to Fred that way - I think what you really want > to use is publish_action ? > > also assumes that Fred is both your friend and has the app installed.. > TemplatizedAction will send to all friends but its abt to be > depreciated.. > > Not sure why youre gettn two of them tho.. probably a side effect of > what youre trying do.. > > brez > > > On Feb 5, 2008 5:52 PM, Joel Nylund wrote: > Hi, I can post to my news feed using: > > # publish to my feed (userF = my facebook user) > @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = > 'joels story title'; s.body = 'joels crazy body'; s)) > > # publish to a friends feed (@fsession = my facebook session) > fred_user = Facebooker::User.new(7779966751, at fsession) > fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = > 'joels just did blah blah'; s.body = 'joels crazy body'; s)) > > When I do this, I get 2 stories in my feed and none in my friends feed. > > any ideas? > > I have seen the news about requiring a session to post to a feed, but > I thought you could still post to your friends feeds (just not your > friends friends). > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com From digidigo at gmail.com Tue Feb 5 22:56:44 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 5 Feb 2008 20:56:44 -0700 Subject: [Facebooker-talk] Built-In Bebo Support In-Reply-To: <1427CA51-BA9B-4B80-B176-6862E480D030@scidept.com> References: <1427CA51-BA9B-4B80-B176-6862E480D030@scidept.com> Message-ID: Hey BJ, I am in the middle of a release right now but would love to start looking at this next week. We talked about this awhile ago on the list and Mike wanted to work on it in parallel, get it working, then look at how you could merge it in. Dave On Feb 5, 2008 2:54 PM, BJ Clark wrote: > Seeing as how Bebo's platform is so close to Facebook's, it makes > sense to me to build in Bebo support to Facebooker. > Is anyone working on this yet and would you guys be open to accepting > patches for this? > Or should I start a bebo specific sub project, or. . . > > Thanks, > BJ > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From jnylund at yahoo.com Wed Feb 6 11:19:51 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Wed, 6 Feb 2008 11:19:51 -0500 Subject: [Facebooker-talk] ajax with facebooker? In-Reply-To: References: <086067E6-4630-4969-A28C-31B8388F7D9C@yahoo.com> Message-ID: Does anyone have a working example of ajax with facebooker & rails running within a canvas? How about using the new "useLocalProxy "? Here is the approach im thinking of: Assumptions: - Since I cant use prototype (I dont think I can at least), as BJ said I cant use the view helpers. - I also cant use the render stuff in the controller as it renders a prototype js response right? Approach Pretty much roll your own (good place for facebooker to pick up the slack maybe?) Ive done some trial and error and here are my problems so far: - If I go through the callback url, I get a bunch of fbml crap in the response of the ajax request, even when I mark it RAW - If I use the local proxy method, I get a direct connect, but what do I do to validate the user is logged in and get their ID in this case? For responses, I could use just a RAW string, or try to encode as JSON? thanks Joel On Jan 25, 2008, at 12:02 PM, BJ Clark wrote: > Joel, > Check out the facebook wiki on this: http://wiki.developers.facebook.com/index.php/FBJS > > As far as in your views, you can't use the built in view helpers, > you'll have to code stuff from scratch as the wiki explains. > In your controllers and models, everything is the same as a regular > rails app. > > BJ > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Jan 25, 2008, at 9:45 AM, Joel Nylund wrote: > >> So if I am using fbml,canvas & facebooker, can I do ajax calls? if so >> how? >> >> From reading it seems they support some sort of mock ajax, but I >> don't really understand, can somone explain to me? >> >> If I cant do ajax, can I still do javascript? >> >> Can I use 3rd party libs like prototype & scriptaculous? >> >> thanks >> Joel >> >> _______________________________________________ >> 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/20080206/43ff7ff4/attachment-0001.html From dustin at dustinanderson.com Wed Feb 6 12:50:47 2008 From: dustin at dustinanderson.com (Dustin Anderson) Date: Wed, 6 Feb 2008 11:50:47 -0600 Subject: [Facebooker-talk] facebooker:tunnel:start Message-ID: Hi All,I'm trying to get tunnelling working so I don't have to cap deploy anymore... Mike Mangino showed us how to do it the other day and he made it look so easy. For some reason, when I type rake facebooker:tunnel:start it throws an error: rake aborted! Don't know how to build task 'facebooker:tunnel:start' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/local/bin/rake:16:in `load' /usr/local/bin/rake:16 Any ideas? I have it installed as a plugin. running on a mac. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080206/47f1621f/attachment.html From david.newbury at gmail.com Wed Feb 6 13:22:46 2008 From: david.newbury at gmail.com (David Newbury) Date: Wed, 6 Feb 2008 12:22:46 -0600 Subject: [Facebooker-talk] ajax with facebooker? In-Reply-To: References: <086067E6-4630-4969-A28C-31B8388F7D9C@yahoo.com> Message-ID: I've been using the javascript with AJAX for a bit. Here are some of the things I've learned: Prototype does not work, so you have to roll your own. If you've got questions, I can answer questions what I'm using, but my code is sadly not abstracted enough yet to use as a library. Hopefully when I have some time. I haven't been able to get useLocalProxy working reliably. It appears to only work on port 80, which makes testing it a pain in the butt--I'll reconfigure my tunnel eventually to hit port 80 and test, but I don't have working experience with that yet. My solution for returning AJAX calls right now is to use render :text=>"something", which is working, but certainly not elegant. You can use yourAjaxObject.requireLogin = true; to pass all the login parameters along with the request. The other tricky thing is that it's not a real AJAX request, so you can't use ".xhr?" to determine if the request is an AJAX call. You have to use "if params[:fb_sig_is_ajax] " instead. My only other suggestion is to use Firebug to watch the calls go out. It helps a lot to see what you're getting back. David Newbury On Feb 6, 2008 10:19 AM, Joel Nylund wrote: > Does anyone have a working example of ajax with facebooker & rails running > within a canvas? > > How about using the new "useLocalProxy "? > > Here is the approach im thinking of: > > Assumptions: > > - Since I cant use prototype (I dont think I can at least), as BJ said I > cant use the view helpers. > - I also cant use the render stuff in the controller as it renders a > prototype js response right? > > Approach > Pretty much roll your own (good place for facebooker to pick up the slack > maybe?) > > Ive done some trial and error and here are my problems so far: > > - If I go through the callback url, I get a bunch of fbml crap in the > response of the ajax request, even when I mark it RAW > > - If I use the local proxy method, I get a direct connect, but what do I do > to validate the user is logged in and get their ID in this case? > > For responses, I could use just a RAW string, or try to encode as JSON? > > thanks > Joel From shanev at gmail.com Wed Feb 6 13:56:09 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 6 Feb 2008 12:56:09 -0600 Subject: [Facebooker-talk] facebooker:tunnel:start In-Reply-To: References: Message-ID: <4ab757a40802061056g57d2262clfedfcd6d0227c427@mail.gmail.com> Dustin- When you do 'rake -T', do you see the facebooker:tunnel tasks? Are you using a relatively recent build of the plugin? -S On Feb 6, 2008 11:50 AM, Dustin Anderson wrote: > Hi All, > I'm trying to get tunnelling working so I don't have to cap deploy > anymore... Mike Mangino showed us how to do it the other day and he made it > look so easy. > > > For some reason, when I type rake facebooker:tunnel:start it throws an > error: > > > rake aborted! > Don't know how to build task 'facebooker:tunnel:start' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 > /usr/local/bin/rake:16:in `load' > /usr/local/bin/rake:16 > > Any ideas? I have it installed as a plugin. running on a mac. > > Thanks! > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com From dustin at dustinanderson.com Wed Feb 6 15:04:01 2008 From: dustin at dustinanderson.com (Dustin Anderson) Date: Wed, 6 Feb 2008 14:04:01 -0600 Subject: [Facebooker-talk] facebooker:tunnel:start In-Reply-To: <4ab757a40802061056g57d2262clfedfcd6d0227c427@mail.gmail.com> References: <4ab757a40802061056g57d2262clfedfcd6d0227c427@mail.gmail.com> Message-ID: I don't have the facebooker tasks... I'm confident that I have an older version that doesn't have the rake tasks. I've done script/plugin update facebooker and it doesn't update anything... it says: Updating plugin: facebooker and then doesn't do any updating... So, maybe I don't really know how to manage plugins? How do I update the plugin? Thanks! Dustin On Feb 6, 2008 12:56 PM, Shane Vitarana wrote: > Dustin- > > When you do 'rake -T', do you see the facebooker:tunnel tasks? Are you > using a relatively recent build of the plugin? > > -S > > On Feb 6, 2008 11:50 AM, Dustin Anderson > wrote: > > Hi All, > > I'm trying to get tunnelling working so I don't have to cap deploy > > anymore... Mike Mangino showed us how to do it the other day and he made > it > > look so easy. > > > > > > For some reason, when I type rake facebooker:tunnel:start it throws an > > error: > > > > > > rake aborted! > > Don't know how to build task 'facebooker:tunnel:start' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > > `standard_exception_handling' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in > `top_level' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > > `standard_exception_handling' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 > > /usr/local/bin/rake:16:in `load' > > /usr/local/bin/rake:16 > > > > Any ideas? I have it installed as a plugin. running on a mac. > > > > Thanks! > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > -- > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com > _______________________________________________ > 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/20080206/114c6c72/attachment.html From shanev at gmail.com Wed Feb 6 16:33:25 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 6 Feb 2008 15:33:25 -0600 Subject: [Facebooker-talk] facebooker:tunnel:start In-Reply-To: References: <4ab757a40802061056g57d2262clfedfcd6d0227c427@mail.gmail.com> Message-ID: <4ab757a40802061333h1bf46fe2x638a2af0fbf6b384@mail.gmail.com> How did you install it initially? Remove it and install it again. This may mess things up if you are using svn externals though. -S On Feb 6, 2008 2:04 PM, Dustin Anderson wrote: > I don't have the facebooker tasks... I'm confident that I have an older > version that doesn't have the rake tasks. I've done script/plugin update > facebooker and it doesn't update anything... it says: > Updating plugin: facebooker > and then doesn't do any updating... > > So, maybe I don't really know how to manage plugins? How do I update the > plugin? > > Thanks! > Dustin > > > > On Feb 6, 2008 12:56 PM, Shane Vitarana wrote: > > Dustin- > > > > When you do 'rake -T', do you see the facebooker:tunnel tasks? Are you > > using a relatively recent build of the plugin? > > > > -S > > > > > > > > > > On Feb 6, 2008 11:50 AM, Dustin Anderson > wrote: > > > Hi All, > > > I'm trying to get tunnelling working so I don't have to cap deploy > > > anymore... Mike Mangino showed us how to do it the other day and he made > it > > > look so easy. > > > > > > > > > For some reason, when I type rake facebooker:tunnel:start it throws an > > > error: > > > > > > > > > rake aborted! > > > Don't know how to build task 'facebooker:tunnel:start' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > > > `standard_exception_handling' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in > `top_level' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > > > `standard_exception_handling' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 > > > /usr/local/bin/rake:16:in `load' > > > /usr/local/bin/rake:16 > > > > > > Any ideas? I have it installed as a plugin. running on a mac. > > > > > > Thanks! > > > _______________________________________________ > > > Facebooker-talk mailing list > > > Facebooker-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > > > > > > -- > > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com From jhsu.x1 at gmail.com Wed Feb 6 17:32:37 2008 From: jhsu.x1 at gmail.com (Joseph Hsu) Date: Wed, 6 Feb 2008 17:32:37 -0500 Subject: [Facebooker-talk] need help with getting users info Message-ID: <515384780802061432k2ed05a34n6fe7a5c59969e8bb@mail.gmail.com> Hi, I'm trying to implement my app into facebook and I am having a little trouble finding anything like getInfo in the docs. I can easily get info on the current user, but how would I get the same info with another user's uid? And would I be able to combine this into one call? I am trying to get names and profile pics (square) of two users. Thanks. I am still fresh in the rails world and especially facebooker (i have used a little of rfacebook, though). -- From, Joseph Hsu http://linkedin.com/in/josephhsu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080206/8426dcbc/attachment.html From jnylund at yahoo.com Wed Feb 6 16:57:08 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Wed, 6 Feb 2008 16:57:08 -0500 Subject: [Facebooker-talk] facebooker:tunnel:start In-Reply-To: <4ab757a40802061333h1bf46fe2x638a2af0fbf6b384@mail.gmail.com> References: <4ab757a40802061056g57d2262clfedfcd6d0227c427@mail.gmail.com> <4ab757a40802061333h1bf46fe2x638a2af0fbf6b384@mail.gmail.com> Message-ID: you also have to do a --force when you reinstall the plugin Joel On Feb 6, 2008, at 4:33 PM, Shane Vitarana wrote: > How did you install it initially? Remove it and install it again. > This may mess things up if you are using svn externals though. > > -S > > On Feb 6, 2008 2:04 PM, Dustin Anderson > wrote: >> I don't have the facebooker tasks... I'm confident that I have an >> older >> version that doesn't have the rake tasks. I've done script/plugin >> update >> facebooker and it doesn't update anything... it says: >> Updating plugin: facebooker >> and then doesn't do any updating... >> >> So, maybe I don't really know how to manage plugins? How do I >> update the >> plugin? >> >> Thanks! >> Dustin >> >> >> >> On Feb 6, 2008 12:56 PM, Shane Vitarana wrote: >>> Dustin- >>> >>> When you do 'rake -T', do you see the facebooker:tunnel tasks? Are >>> you >>> using a relatively recent build of the plugin? >>> >>> -S >>> >>> >>> >>> >>> On Feb 6, 2008 11:50 AM, Dustin Anderson >> wrote: >>>> Hi All, >>>> I'm trying to get tunnelling working so I don't have to cap deploy >>>> anymore... Mike Mangino showed us how to do it the other day and >>>> he made >> it >>>> look so easy. >>>> >>>> >>>> For some reason, when I type rake facebooker:tunnel:start it >>>> throws an >>>> error: >>>> >>>> >>>> rake aborted! >>>> Don't know how to build task 'facebooker:tunnel:start' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in >>>> `[]' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in >> `top_level' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in >>>> `each' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in >> `top_level' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in >>>> `standard_exception_handling' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in >> `top_level' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in >>>> `run' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in >>>> `standard_exception_handling' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in >>>> `run' >>>> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 >>>> /usr/local/bin/rake:16:in `load' >>>> /usr/local/bin/rake:16 >>>> >>>> Any ideas? I have it installed as a plugin. running on a mac. >>>> >>>> Thanks! >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>> >>> >>> >>> -- >>> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >> >> > > > > -- > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From bjclark at scidept.com Wed Feb 6 19:46:46 2008 From: bjclark at scidept.com (BJ Clark) Date: Wed, 6 Feb 2008 17:46:46 -0700 Subject: [Facebooker-talk] Built-In Bebo Support Message-ID: My co-worker and have been working on this all day. I think we're pretty close, but I'm having a problem trying to modify session.rb to work wtih both bebo and facebook support. Here's what I've done: I changed facebooker.yml to have a bebo_secret_key, bebo_api_key, etc. Then, in init.rb I did: facebook_config = "#{RAILS_ROOT}/config/facebooker.yml" if File.exist?(facebook_config) FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV] ENV['FACEBOOK_API_KEY'] = FACEBOOKER['api_key'] ENV['FACEBOOK_SECRET_KEY'] = FACEBOOKER['secret_key'] ENV['FACEBOOKER_RELATIVE_URL_ROOT'] = FACEBOOKER['canvas_page_name'] ENV["FACEBOOK_CANVAS_PATH"] = 'blah_blah' ENV['BEBO_API_KEY'] = FACEBOOKER['bebo_api_key'] ENV['BEBO_SECRET_KEY'] = FACEBOOKER['bebo_secret_key'] ENV['BEBO_RELATIVE_URL_ROOT'] = FACEBOOKER['bebo_canvas_page_name'] ENV["BEBO_CANVAS_PATH"] = 'blah_blah' end So, then in session.rb I see that this gets called when it goes to secure the session: def self.secret_key extract_key_from_environment(:secret) || extract_key_from_configuration_file(:secret) rescue report_inability_to_find_key(:secret) end and that should be calling the extract_key_from_environment method. So I modified it to look like this (and this is where I get stuck): def self.extract_key_from_environment(key_name) if params[:fb_sig_network] == "Bebo" logger.debug "Extracting bebo #{key_name.to_s}" val = ENV["BEBO_" + key_name.to_s.upcase + "_KEY"] else logger.debug "Extracting facebook #{key_name.to_s}" val = ENV["FACEBOOK_" + key_name.to_s.upcase + "_KEY"] end end I always get the error "Facebooker::Session::ConfigurationMissing (Could not find configuration information for secret):" The logger.debug message never get called (which really confuses me). Now, If use the code that is currently in the plugin, I have no problem on facebook, and bebo gives me the IncorrectSignature error, which is the correct behavior. I don't understand why it's failing like this. Anyone have any suggestions? Thanks, ----- BJ Clark the science department bjclark at scidept.com www.scidept.com > Hey BJ, > > I am in the middle of a release right now but would love to start > looking at this next week. We talked about this awhile ago on the > list and Mike wanted to work on it in parallel, get it working, then > look at how you could merge it in. > > Dave > > On Feb 5, 2008 2:54 PM, BJ Clark wrote: > > Seeing as how Bebo's platform is so close to Facebook's, it makes > > sense to me to build in Bebo support to Facebooker. > > Is anyone working on this yet and would you guys be open to > accepting > > patches for this? > > Or should I start a bebo specific sub project, or. . . > > > > Thanks, > > BJ > > ----- > > BJ Clark > > the science department > > bjclark at scidept.com > > www.scidept.com > > > > > > _______________________________________________ > > 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/20080206/fedcae01/attachment.html From chris at cobaltedge.com Wed Feb 6 20:01:22 2008 From: chris at cobaltedge.com (Christopher Bailey) Date: Wed, 6 Feb 2008 17:01:22 -0800 Subject: [Facebooker-talk] Testing and Mocking Message-ID: <443c240c0802061701v36e89cdcofec9ed659bb0b393@mail.gmail.com> Hi, I'm wondering if folks would care to share what strategies they're using, or tips and tricks for writing functional tests for their apps that use Facebooker? I'm starting to look into this, but wanted to see what others had come up with before going too far. -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080206/ceb81b68/attachment.html From jnylund at yahoo.com Wed Feb 6 21:12:50 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Wed, 6 Feb 2008 21:12:50 -0500 Subject: [Facebooker-talk] rails facebook examples Message-ID: Hi Folks, thanks for the help today, I think I got it working pretty well, I have posted 3 examples on using ajax with rails & facebook. Not really facebooker specific stuff, but thought the list might like to have for reference. Posting is here: http://jnylund.typepad.com/joels_blog/2008/02/ajax-rails-face.html thanks Joel From digidigo at gmail.com Wed Feb 6 22:47:01 2008 From: digidigo at gmail.com (David Clements) Date: Wed, 6 Feb 2008 20:47:01 -0700 Subject: [Facebooker-talk] Built-In Bebo Support In-Reply-To: References: Message-ID: Hey BJ, On first pass I am wondering where are you getting 'params' from? I think you are catching an exception there and the rescue is taking care of it. Just a guess, I didn't try it. Dave On Feb 6, 2008 5:46 PM, BJ Clark wrote: > > My co-worker and have been working on this all day. I think we're pretty > close, but I'm having a problem trying to modify session.rb to work wtih > both bebo and facebook support. > > Here's what I've done: > I changed facebooker.yml to have a bebo_secret_key, bebo_api_key, etc. > Then, in init.rb I did: > > > facebook_config = "#{RAILS_ROOT}/config/facebooker.yml" > > if File.exist?(facebook_config) > FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV] > ENV['FACEBOOK_API_KEY'] = FACEBOOKER['api_key'] > ENV['FACEBOOK_SECRET_KEY'] = FACEBOOKER['secret_key'] > ENV['FACEBOOKER_RELATIVE_URL_ROOT'] = FACEBOOKER['canvas_page_name'] > ENV["FACEBOOK_CANVAS_PATH"] = 'blah_blah' > ENV['BEBO_API_KEY'] = FACEBOOKER['bebo_api_key'] > ENV['BEBO_SECRET_KEY'] = FACEBOOKER['bebo_secret_key'] > ENV['BEBO_RELATIVE_URL_ROOT'] = FACEBOOKER['bebo_canvas_page_name'] > ENV["BEBO_CANVAS_PATH"] = 'blah_blah' > end > > So, then in session.rb I see that this gets called when it goes to secure > the session: > def self.secret_key > extract_key_from_environment(:secret) || > extract_key_from_configuration_file(:secret) rescue > report_inability_to_find_key(:secret) > end > > > and that should be calling the extract_key_from_environment method. > So I modified it to look like this (and this is where I get stuck): > > > def self.extract_key_from_environment(key_name) > if params[:fb_sig_network] == "Bebo" > logger.debug "Extracting bebo #{key_name.to_s}" > val = ENV["BEBO_" + key_name.to_s.upcase + "_KEY"] > else > logger.debug "Extracting facebook #{key_name.to_s}" > val = ENV["FACEBOOK_" + key_name.to_s.upcase + "_KEY"] > end > end > > I always get the error "Facebooker::Session::ConfigurationMissing (Could not > find configuration information for secret):" > The logger.debug message never get called (which really confuses me). > Now, If use the code that is currently in the plugin, I have no problem on > facebook, and bebo gives me the IncorrectSignature error, which is the > correct behavior. > > I don't understand why it's failing like this. > Anyone have any suggestions? > > Thanks, > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > > Hey BJ, > > I am in the middle of a release right now but would love to start > looking at this next week. We talked about this awhile ago on the > list and Mike wanted to work on it in parallel, get it working, then > look at how you could merge it in. > > Dave > > > On Feb 5, 2008 2:54 PM, BJ Clark wrote: > > Seeing as how Bebo's platform is so close to Facebook's, it makes > > sense to me to build in Bebo support to Facebooker. > > Is anyone working on this yet and would you guys be open to accepting > > patches for this? > > Or should I start a bebo specific sub project, or. . . > > > > Thanks, > > BJ > > ----- > > BJ Clark > > the science department > > bjclark at scidept.com > > www.scidept.com > > > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > From mmangino at elevatedrails.com Thu Feb 7 10:04:36 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 7 Feb 2008 09:04:36 -0600 Subject: [Facebooker-talk] ajax with facebooker? In-Reply-To: References: <086067E6-4630-4969-A28C-31B8388F7D9C@yahoo.com> Message-ID: I have a fb_link_to_remote that works with :update, let me try to clean that up and add it in. Mike On Feb 6, 2008, at 10:19 AM, Joel Nylund wrote: > Does anyone have a working example of ajax with facebooker & rails > running within a canvas? > > How about using the new "useLocalProxy "? > > Here is the approach im thinking of: > > Assumptions: > > - Since I cant use prototype (I dont think I can at least), as BJ > said I cant use the view helpers. > - I also cant use the render stuff in the controller as it renders a > prototype js response right? > > Approach > Pretty much roll your own (good place for facebooker to pick up the > slack maybe?) > > Ive done some trial and error and here are my problems so far: > > - If I go through the callback url, I get a bunch of fbml crap in > the response of the ajax request, even when I mark it RAW > > - If I use the local proxy method, I get a direct connect, but what > do I do to validate the user is logged in and get their ID in this > case? > > For responses, I could use just a RAW string, or try to encode as > JSON? > > thanks > Joel > > On Jan 25, 2008, at 12:02 PM, BJ Clark wrote: > >> Joel, >> Check out the facebook wiki on this: http://wiki.developers.facebook.com/index.php/FBJS >> >> As far as in your views, you can't use the built in view helpers, >> you'll have to code stuff from scratch as the wiki explains. >> In your controllers and models, everything is the same as a regular >> rails app. >> >> BJ >> ----- >> BJ Clark >> the science department >> bjclark at scidept.com >> www.scidept.com >> >> >> On Jan 25, 2008, at 9:45 AM, Joel Nylund wrote: >> >>> So if I am using fbml,canvas & facebooker, can I do ajax calls? if >>> so >>> how? >>> >>> From reading it seems they support some sort of mock ajax, but I >>> don't really understand, can somone explain to me? >>> >>> If I cant do ajax, can I still do javascript? >>> >>> Can I use 3rd party libs like prototype & scriptaculous? >>> >>> thanks >>> Joel >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From digidigo at gmail.com Thu Feb 7 12:57:55 2008 From: digidigo at gmail.com (David Clements) Date: Thu, 7 Feb 2008 10:57:55 -0700 Subject: [Facebooker-talk] Built-In Bebo Support In-Reply-To: References: Message-ID: Hey BJ, take a look at facebook_session_handling this seems like a good place to figure this out. You could set somthing up on the CGI:Session that would indicate which context you are in. I am CC the list here so that others can get a feel for what the issues are. Dave On Feb 6, 2008 9:12 PM, BJ Clark wrote: > Dave, > Thanks, yeah, I thought params might be available in the plugin's > context. > bebo sends a fb_sig_network url parameter on all requests, so we're > trying to use this as a basis of setting up the correct session using > the correct api and secret keys. Any thoughts on how we could make > that parameter available there? My rails plugin development fu is > weak. :) > > Thanks, > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > > On Feb 6, 2008, at 8:47 PM, David Clements wrote: > > > Hey BJ, > > > > On first pass I am wondering where are you getting 'params' from? > > > > I think you are catching an exception there and the rescue is taking > > care of it. > > > > Just a guess, I didn't try it. > > > > Dave > > > > On Feb 6, 2008 5:46 PM, BJ Clark wrote: > >> > >> My co-worker and have been working on this all day. I think we're > >> pretty > >> close, but I'm having a problem trying to modify session.rb to work > >> wtih > >> both bebo and facebook support. > >> > >> Here's what I've done: > >> I changed facebooker.yml to have a bebo_secret_key, bebo_api_key, > >> etc. > >> Then, in init.rb I did: > >> > >> > >> facebook_config = "#{RAILS_ROOT}/config/facebooker.yml" > >> > >> if File.exist?(facebook_config) > >> FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV] > >> ENV['FACEBOOK_API_KEY'] = FACEBOOKER['api_key'] > >> ENV['FACEBOOK_SECRET_KEY'] = FACEBOOKER['secret_key'] > >> ENV['FACEBOOKER_RELATIVE_URL_ROOT'] = FACEBOOKER['canvas_page_name'] > >> ENV["FACEBOOK_CANVAS_PATH"] = 'blah_blah' > >> ENV['BEBO_API_KEY'] = FACEBOOKER['bebo_api_key'] > >> ENV['BEBO_SECRET_KEY'] = FACEBOOKER['bebo_secret_key'] > >> ENV['BEBO_RELATIVE_URL_ROOT'] = FACEBOOKER['bebo_canvas_page_name'] > >> ENV["BEBO_CANVAS_PATH"] = 'blah_blah' > >> end > >> > >> So, then in session.rb I see that this gets called when it goes to > >> secure > >> the session: > >> def self.secret_key > >> extract_key_from_environment(:secret) || > >> extract_key_from_configuration_file(:secret) rescue > >> report_inability_to_find_key(:secret) > >> end > >> > >> > >> and that should be calling the extract_key_from_environment method. > >> So I modified it to look like this (and this is where I get stuck): > >> > >> > >> def self.extract_key_from_environment(key_name) > >> if params[:fb_sig_network] == "Bebo" > >> logger.debug "Extracting bebo #{key_name.to_s}" > >> val = ENV["BEBO_" + key_name.to_s.upcase + "_KEY"] > >> else > >> logger.debug "Extracting facebook #{key_name.to_s}" > >> val = ENV["FACEBOOK_" + key_name.to_s.upcase + "_KEY"] > >> end > >> end > >> > >> I always get the error "Facebooker::Session::ConfigurationMissing > >> (Could not > >> find configuration information for secret):" > >> The logger.debug message never get called (which really confuses me). > >> Now, If use the code that is currently in the plugin, I have no > >> problem on > >> facebook, and bebo gives me the IncorrectSignature error, which is > >> the > >> correct behavior. > >> > >> I don't understand why it's failing like this. > >> Anyone have any suggestions? > >> > >> Thanks, > >> ----- > >> BJ Clark > >> the science department > >> bjclark at scidept.com > >> www.scidept.com > >> > >> > >> > >> Hey BJ, > >> > >> I am in the middle of a release right now but would love to start > >> looking at this next week. We talked about this awhile ago on the > >> list and Mike wanted to work on it in parallel, get it working, then > >> look at how you could merge it in. > >> > >> Dave > >> > >> > >> On Feb 5, 2008 2:54 PM, BJ Clark wrote: > >>> Seeing as how Bebo's platform is so close to Facebook's, it makes > >>> sense to me to build in Bebo support to Facebooker. > >>> Is anyone working on this yet and would you guys be open to > >>> accepting > >>> patches for this? > >>> Or should I start a bebo specific sub project, or. . . > >>> > >>> Thanks, > >>> BJ > >>> ----- > >>> BJ Clark > >>> the science department > >>> bjclark at scidept.com > >>> www.scidept.com > >>> > >>> > >>> _______________________________________________ > >>> Facebooker-talk mailing list > >>> Facebooker-talk at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/facebooker-talk > >>> > >> > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Facebooker-talk mailing list > >> Facebooker-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/facebooker-talk > >> > >> > > From digidigo at gmail.com Thu Feb 7 13:13:04 2008 From: digidigo at gmail.com (David Clements) Date: Thu, 7 Feb 2008 11:13:04 -0700 Subject: [Facebooker-talk] Doc confusion for publichTemplatizedAction Message-ID: Hey All, I recently go re-confused about the differece between publichActionOfUser and publishTemplatizedAction. My confusion was around how to publish stories to users that haven't installed the application yet. What I found was that the documentation is not consistant. The WIKI states that the feed item will 'possibly' be published to user who do not yet have the app. http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction "Feed.publishTemplatizedAction Publishes a Mini-Feed story to the user or Page corresponding to the session_key or page_actor_id parameter. For user stories, this function publishes News Feed stories to the friends of that user." The documentation page states that it will only be published to user that have installed the app. http://developers.facebook.com/documentation.php?v=1.0&method=feed.publishTemplatizedAction "facebook.feed.publishTemplatizedAction Publishes a Mini-Feed story to the user corresponding to the session_key parameter, and publishes News Feed stories to the friends of that user who have added the application." I think that the wiki is correct, since I see this happen in the real world. Anyone have an insight? Dave From mmangino at elevatedrails.com Thu Feb 7 14:15:01 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 7 Feb 2008 13:15:01 -0600 Subject: [Facebooker-talk] Doc confusion for publichTemplatizedAction In-Reply-To: References: Message-ID: <65890088-91D7-4B65-A45E-81748F78361A@elevatedrails.com> You aren't publishing an action to a user, You publish the action of one of your application users which may or may not be shown to people who haven't installed your application. If you want to send a message to a user who hasn't installed the application, you can use a notification. Mike On Feb 7, 2008, at 12:13 PM, David Clements wrote: > Hey All, > > I recently go re-confused about the differece between > publichActionOfUser and publishTemplatizedAction. > > My confusion was around how to publish stories to users that haven't > installed the application yet. What I found was that the > documentation is not consistant. > > > The WIKI states that the feed item will 'possibly' be published to > user who do not yet have the app. > > http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction > > "Feed.publishTemplatizedAction > Publishes a Mini-Feed story to the user or Page corresponding to the > session_key or page_actor_id parameter. For user stories, this > function publishes News Feed stories to the friends of that user." > > The documentation page states that it will only be published to user > that have installed the app. > > http://developers.facebook.com/documentation.php?v=1.0&method=feed.publishTemplatizedAction > "facebook.feed.publishTemplatizedAction > Publishes a Mini-Feed story to the user corresponding to the > session_key parameter, and publishes News Feed stories to the friends > of that user who have added the application." > > I think that the wiki is correct, since I see this happen in the real > world. Anyone have an insight? > > > Dave > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From digidigo at gmail.com Thu Feb 7 14:51:19 2008 From: digidigo at gmail.com (David Clements) Date: Thu, 7 Feb 2008 12:51:19 -0700 Subject: [Facebooker-talk] Doc confusion for publichTemplatizedAction In-Reply-To: <65890088-91D7-4B65-A45E-81748F78361A@elevatedrails.com> References: <65890088-91D7-4B65-A45E-81748F78361A@elevatedrails.com> Message-ID: Right, So the wiki documentation is correct and the developer doc is incorrect? Or am I missing, mis-reading, something. Dave On Feb 7, 2008 12:15 PM, Mike Mangino wrote: > You aren't publishing an action to a user, > > You publish the action of one of your application users which may or > may not be shown to people who haven't installed your application. If > you want to send a message to a user who hasn't installed the > application, you can use a notification. > > Mike > > > On Feb 7, 2008, at 12:13 PM, David Clements wrote: > > > Hey All, > > > > I recently go re-confused about the differece between > > publichActionOfUser and publishTemplatizedAction. > > > > My confusion was around how to publish stories to users that haven't > > installed the application yet. What I found was that the > > documentation is not consistant. > > > > > > The WIKI states that the feed item will 'possibly' be published to > > user who do not yet have the app. > > > > http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction > > > > "Feed.publishTemplatizedAction > > Publishes a Mini-Feed story to the user or Page corresponding to the > > session_key or page_actor_id parameter. For user stories, this > > function publishes News Feed stories to the friends of that user." > > > > The documentation page states that it will only be published to user > > that have installed the app. > > > > http://developers.facebook.com/documentation.php?v=1.0&method=feed.publishTemplatizedAction > > "facebook.feed.publishTemplatizedAction > > Publishes a Mini-Feed story to the user corresponding to the > > session_key parameter, and publishes News Feed stories to the friends > > of that user who have added the application." > > > > I think that the wiki is correct, since I see this happen in the real > > world. Anyone have an insight? > > > > > > Dave > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > From jnylund at yahoo.com Thu Feb 7 17:23:06 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Thu, 7 Feb 2008 17:23:06 -0500 Subject: [Facebooker-talk] Doc confusion for publichTemplatizedAction In-Reply-To: References: <65890088-91D7-4B65-A45E-81748F78361A@elevatedrails.com> Message-ID: <469861D6-0E05-48E2-B503-B9FDEEBF1714@yahoo.com> Good discussion on this here: http://forum.developers.facebook.com/viewtopic.php?id=9020 I did a test the other day, it took at least several hours to show up on a feed with the app installed and without it, but it did for both Joel On Feb 7, 2008, at 2:51 PM, David Clements wrote: > Right, > > So the wiki documentation is correct and the developer doc is > incorrect? Or am I missing, mis-reading, something. > > Dave > > On Feb 7, 2008 12:15 PM, Mike Mangino > wrote: >> You aren't publishing an action to a user, >> >> You publish the action of one of your application users which may or >> may not be shown to people who haven't installed your application. If >> you want to send a message to a user who hasn't installed the >> application, you can use a notification. >> >> Mike >> >> >> On Feb 7, 2008, at 12:13 PM, David Clements wrote: >> >>> Hey All, >>> >>> I recently go re-confused about the differece between >>> publichActionOfUser and publishTemplatizedAction. >>> >>> My confusion was around how to publish stories to users that haven't >>> installed the application yet. What I found was that the >>> documentation is not consistant. >>> >>> >>> The WIKI states that the feed item will 'possibly' be published to >>> user who do not yet have the app. >>> >>> http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction >>> >>> "Feed.publishTemplatizedAction >>> Publishes a Mini-Feed story to the user or Page corresponding to the >>> session_key or page_actor_id parameter. For user stories, this >>> function publishes News Feed stories to the friends of that user." >>> >>> The documentation page states that it will only be published to user >>> that have installed the app. >>> >>> http://developers.facebook.com/documentation.php?v=1.0&method=feed.publishTemplatizedAction >>> "facebook.feed.publishTemplatizedAction >>> Publishes a Mini-Feed story to the user corresponding to the >>> session_key parameter, and publishes News Feed stories to the >>> friends >>> of that user who have added the application." >>> >>> I think that the wiki is correct, since I see this happen in the >>> real >>> world. Anyone have an insight? >>> >>> >>> Dave >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From arussell at gmail.com Thu Feb 7 19:16:06 2008 From: arussell at gmail.com (Aaron Russell) Date: Fri, 8 Feb 2008 00:16:06 +0000 Subject: [Facebooker-talk] Error calling session.send_invitation Message-ID: <351dab120802071616w792b7f5y86773b960aeb09e7@mail.gmail.com> Having some problems with the following code: @session = session[:facebook_session] user_ids = params[:ids] invitation_type = "foo" content = "bar" image_url = "quux" @session.send_invitation(user_ids,invitation_type,content,image_url) It's dying with this: NoMethodError (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:332: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:329:in `post' /vendor/plugins/facebooker/lib/facebooker/session.rb:389:in `send_request_or_invitation' /vendor/plugins/facebooker/lib/facebooker/session.rb:268:in `send_invitation' /app/controllers/pages_controller.rb:14:in `send_invite' I'm guessing I'm calling send_invitation incorrectly, but I'm confused about how... From digidigo at gmail.com Thu Feb 7 19:27:16 2008 From: digidigo at gmail.com (David Clements) Date: Thu, 7 Feb 2008 17:27:16 -0700 Subject: [Facebooker-talk] Error calling session.send_invitation In-Reply-To: <351dab120802071616w792b7f5y86773b960aeb09e7@mail.gmail.com> References: <351dab120802071616w792b7f5y86773b960aeb09e7@mail.gmail.com> Message-ID: Don't know off the top of my head what might be wrong with your code, I seem to remember that the URL needs to be valid. But anyway the code is blowing up because we are not finding the error code in our list of error codes. BTW: Looks like your version of Facebooker might be out of date? Line 332 for me is part of a hash assignment and doesn't have the line I think you are blowing up on. raise EXCEPTIONS[Integer(hash['error_code'])].new(hash['error_msg']) Can you add some debug info into process method on the parser right before it blows up? It would be great to know what that error code is. Thanks, Dave On Feb 7, 2008 5:16 PM, Aaron Russell wrote: > Having some problems with the following code: > > @session = session[:facebook_session] > user_ids = params[:ids] > invitation_type = "foo" > content = "bar" > image_url = "quux" > @session.send_invitation(user_ids,invitation_type,content,image_url) > > It's dying with this: > > NoMethodError (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:332: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:329:in `post' > /vendor/plugins/facebooker/lib/facebooker/session.rb:389:in > `send_request_or_invitation' > /vendor/plugins/facebooker/lib/facebooker/session.rb:268:in > `send_invitation' > /app/controllers/pages_controller.rb:14:in `send_invite' > > I'm guessing I'm calling send_invitation incorrectly, but I'm confused > about how... > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From digidigo at gmail.com Fri Feb 8 10:55:58 2008 From: digidigo at gmail.com (David Clements) Date: Fri, 8 Feb 2008 08:55:58 -0700 Subject: [Facebooker-talk] Error calling session.send_invitation In-Reply-To: <351dab120802080651w3d2f732ep9941596da6dc83e6@mail.gmail.com> References: <351dab120802071616w792b7f5y86773b960aeb09e7@mail.gmail.com> <351dab120802071723y293b372nf7be445ace63b42b@mail.gmail.com> <351dab120802080651w3d2f732ep9941596da6dc83e6@mail.gmail.com> Message-ID: Hey Aaron, Can you update your facebooker codebase. This method was removed from the facebook API : http://wiki.developers.facebook.com/index.php/Notifications.sendRequest I think there have been some updates made by mike recently regarding this. CC the list so that all can benefit. Dave On Feb 8, 2008 7:51 AM, Aaron Russell wrote: > That seems to have dumped out the contents of hash nicely: > > --- > error_msg: Unknown method > request_args: > - value: MyApp > key: type > - value: MyContent > key: content > - value: "true" > key: invitation > - value: facebook.notifications.sendRequest > key: method > - value: (redacted) > key: api_key > - value: "1202482140.24332" > key: call_id > - value: (redacted) > key: sig > - value: http://photos-b.ak.facebook.com/someimage.gif > key: image > - value: "1.0" > key: v > - value: (redacted) > key: session_key > - value: "23946" > key: to_ids > error_code: "3" > > > > On Feb 8, 2008 3:18 AM, David Clements wrote: > > You can try RAILS_DEFAULT_LOGGER.error(hash.to_yaml) > > > > That should spit it out to development.log > > > > Dave > > > > > > > > > > On Feb 7, 2008 6:23 PM, Aaron Russell wrote: > > > That is actually the line I'm blowing up on. > > > > > > I'm new to Rails and Ruby, so I'm not entirely sure how to get the > > > information out. I tried "puts hash" but I have no idea where STDOUT is > > > actually pointing to. I'm guessing there's a more sensible way of getting > > > this information than just adding "puts varname", though. > > > > > > > > > > > > On Feb 8, 2008 12:27 AM, David Clements wrote: > > > > Don't know off the top of my head what might be wrong with your code, > > > > I seem to remember that the URL needs to be valid. > > > > > > > > But anyway the code is blowing up because we are not finding the error > > > > code in our list of error codes. > > > > > > > > BTW: Looks like your version of Facebooker might be out of date? Line > > > > 332 for me is part of a hash assignment and doesn't have the line I > > > > think you are blowing up on. > > > > > > > > raise > > > EXCEPTIONS[Integer(hash['error_code'])].new(hash['error_msg']) > > > > > > > > > > > > Can you add some debug info into process method on the parser right > > > > before it blows up? It would be great to know what that error code > > > > is. > > > > > > > > > > > > Thanks, > > > > Dave > > > > > > > > > > > > > > > > > > > > > > > > On Feb 7, 2008 5:16 PM, Aaron Russell wrote: > > > > > Having some problems with the following code: > > > > > > > > > > @session = session[:facebook_session] > > > > > user_ids = params[:ids] > > > > > invitation_type = "foo" > > > > > content = "bar" > > > > > image_url = "quux" > > > > > @session.send_invitation(user_ids,invitation_type,content,image_url) > > > > > > > > > > It's dying with this: > > > > > > > > > > NoMethodError (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:332: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:329:in `post' > > > > > /vendor/plugins/facebooker/lib/facebooker/session.rb:389:in > > > > > `send_request_or_invitation' > > > > > /vendor/plugins/facebooker/lib/facebooker/session.rb:268:in > > > > > `send_invitation' > > > > > /app/controllers/pages_controller.rb:14:in `send_invite' > > > > > > > > > > I'm guessing I'm calling send_invitation incorrectly, but I'm confused > > > > > about how... > > > > > _______________________________________________ > > > > > Facebooker-talk mailing list > > > > > Facebooker-talk at rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > > > > > > > > > > From jnylund at yahoo.com Fri Feb 8 11:03:35 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Fri, 8 Feb 2008 11:03:35 -0500 Subject: [Facebooker-talk] Error calling session.send_invitation In-Reply-To: References: <351dab120802071616w792b7f5y86773b960aeb09e7@mail.gmail.com> <351dab120802071723y293b372nf7be445ace63b42b@mail.gmail.com> <351dab120802080651w3d2f732ep9941596da6dc83e6@mail.gmail.com> Message-ID: <916FFE3A-6E66-44FB-8821-FA95BAAF409D@yahoo.com> Hi Guys, I posted some code a while ago to log facebook rest calls, I cant think of a good way to put this into facebooker without adding rails dependency, but it seems like it would be helpful. Does anyone have any ideas, where we can get good rest call logging in dev but nothing in prod. I know you are trying to keep facebooker pure ruby and this method is in the ruby part (not the rails part). Is there a standard logger for ruby that everyone uses (like log4j in the java world)? Here is my version with rails logger: (in Service class change the post method to: ) def post(params) logger.debug "About to post to :" + url.to_s logger.debug "with params:" params.each { |elem| logger.debug elem[0].to_s + " : " + elem[1].to_s} resp,data = Net::HTTP.post_form(url, params) logger.debug "Result: " + resp.to_s logger.debug "Response Data: " + data.to_s Parser.parse(params[:method],resp) end thanks Joel On Feb 8, 2008, at 10:55 AM, David Clements wrote: > Hey Aaron, > > Can you update your facebooker codebase. This method was removed from > the facebook API : > http://wiki.developers.facebook.com/index.php/ > Notifications.sendRequest > > I think there have been some updates made by mike recently regarding > this. > > > CC the list so that all can benefit. > Dave > > On Feb 8, 2008 7:51 AM, Aaron Russell wrote: >> That seems to have dumped out the contents of hash nicely: >> >> --- >> error_msg: Unknown method >> request_args: >> - value: MyApp >> key: type >> - value: MyContent >> key: content >> - value: "true" >> key: invitation >> - value: facebook.notifications.sendRequest >> key: method >> - value: (redacted) >> key: api_key >> - value: "1202482140.24332" >> key: call_id >> - value: (redacted) >> key: sig >> - value: http://photos-b.ak.facebook.com/someimage.gif >> key: image >> - value: "1.0" >> key: v >> - value: (redacted) >> key: session_key >> - value: "23946" >> key: to_ids >> error_code: "3" >> >> >> >> On Feb 8, 2008 3:18 AM, David Clements wrote: >>> You can try RAILS_DEFAULT_LOGGER.error(hash.to_yaml) >>> >>> That should spit it out to development.log >>> >>> Dave >>> >>> >>> >>> >>> On Feb 7, 2008 6:23 PM, Aaron Russell wrote: >>>> That is actually the line I'm blowing up on. >>>> >>>> I'm new to Rails and Ruby, so I'm not entirely sure how to get the >>>> information out. I tried "puts hash" but I have no idea where >>>> STDOUT is >>>> actually pointing to. I'm guessing there's a more sensible way of >>>> getting >>>> this information than just adding "puts varname", though. >>>> >>>> >>>> >>>> On Feb 8, 2008 12:27 AM, David Clements wrote: >>>>> Don't know off the top of my head what might be wrong with your >>>>> code, >>>>> I seem to remember that the URL needs to be valid. >>>>> >>>>> But anyway the code is blowing up because we are not finding the >>>>> error >>>>> code in our list of error codes. >>>>> >>>>> BTW: Looks like your version of Facebooker might be out of >>>>> date? Line >>>>> 332 for me is part of a hash assignment and doesn't have the >>>>> line I >>>>> think you are blowing up on. >>>>> >>>>> raise >>>> EXCEPTIONS[Integer(hash['error_code'])].new(hash['error_msg']) >>>>> >>>>> >>>>> Can you add some debug info into process method on the parser >>>>> right >>>>> before it blows up? It would be great to know what that error >>>>> code >>>>> is. >>>>> >>>>> >>>>> Thanks, >>>>> Dave >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Feb 7, 2008 5:16 PM, Aaron Russell wrote: >>>>>> Having some problems with the following code: >>>>>> >>>>>> @session = session[:facebook_session] >>>>>> user_ids = params[:ids] >>>>>> invitation_type = "foo" >>>>>> content = "bar" >>>>>> image_url = "quux" >>>>>> @session >>>>>> .send_invitation(user_ids,invitation_type,content,image_url) >>>>>> >>>>>> It's dying with this: >>>>>> >>>>>> NoMethodError (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:332: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:329:in >>>>>> `post' >>>>>> /vendor/plugins/facebooker/lib/facebooker/session.rb:389:in >>>>>> `send_request_or_invitation' >>>>>> /vendor/plugins/facebooker/lib/facebooker/session.rb:268:in >>>>>> `send_invitation' >>>>>> /app/controllers/pages_controller.rb:14:in `send_invite' >>>>>> >>>>>> I'm guessing I'm calling send_invitation incorrectly, but I'm >>>>>> confused >>>>>> about how... >>>>>> _______________________________________________ >>>>>> Facebooker-talk mailing list >>>>>> Facebooker-talk at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>>> >>>>> >>>> >>>> >>> >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From brian at hwrd.com Fri Feb 8 17:20:13 2008 From: brian at hwrd.com (Brian Howenstein) Date: Fri, 8 Feb 2008 17:20:13 -0500 Subject: [Facebooker-talk] RESTful delete Message-ID: I may be missing something, but I am unable to do a RESTful delete using Facebooker. In routes.rb, I have: map.resources :runs I am using the following to try and delete: <%= link_to "Delete", run, :method => :delete %> However, instead of calling 'delete' it does the 'show' action. How can I do a RESTful delete using Facebooker? Thanks, Brian From digidigo at gmail.com Mon Feb 11 18:31:00 2008 From: digidigo at gmail.com (David Clements) Date: Mon, 11 Feb 2008 16:31:00 -0700 Subject: [Facebooker-talk] Facebooker Tutorial -- The App Message-ID: Hey All, I have been working on a a Facebooker Tutorial application. The main idea is to take all these code snippets that I create answering questions, or testing out functionality and wrap them up into mini lessons. All the code examples in the tutorial are live and come direct from the file system. What I have so far is just the start, I have another 10 - 15 examples on my filesystem that I need to pull together. I would love some feedback if anyone has any time. http://apps.facebook.com/facebooker_tutorial/ Don't worry you don't have to invite 20 friends to check it out, :) Thanks, Dave From jnylund at yahoo.com Mon Feb 11 21:19:08 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Mon, 11 Feb 2008 21:19:08 -0500 Subject: [Facebooker-talk] Facebooker Tutorial -- The App In-Reply-To: References: Message-ID: <7E499369-7F66-4A05-A8C7-E6FD71B2A154@yahoo.com> Dave, this is awesome! I wish I had it a few weeks ago when I was starting Facebooker! Very Cool! Couple small things: - invite your friends skip button doesn't go anywhere for me. (didnt know if there was another tutorial) - missing 'e' on your text next the users at top of invite friends ("th users") also, im not sure if its a rails 2 thing or what (and maybe some of the gurus on this list can enlighten me) , but in rails 1.2, I had to add an actual before_filter to add an :except clause. Im not sure the diff between: ensure_authenticated_to_facebook [:except => 'add_facebook_application'] and before_filter :ensure_authenticated_to_facebook [:except => 'add_facebook_application'] Joel On Feb 11, 2008, at 6:31 PM, David Clements wrote: > Hey All, > > I have been working on a a Facebooker Tutorial application. The main > idea is to take all these code snippets that I create answering > questions, or testing out functionality and wrap them up into mini > lessons. All the code examples in the tutorial are live and come > direct from the file system. What I have so far is just the start, I > have another 10 - 15 examples on my filesystem that I need to pull > together. > > I would love some feedback if anyone has any time. > > http://apps.facebook.com/facebooker_tutorial/ > > Don't worry you don't have to invite 20 friends to check it out, :) > > Thanks, > > Dave > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From digidigo at gmail.com Mon Feb 11 22:23:21 2008 From: digidigo at gmail.com (David Clements) Date: Mon, 11 Feb 2008 20:23:21 -0700 Subject: [Facebooker-talk] Facebooker development In-Reply-To: <975493.58414.qm@web58711.mail.re1.yahoo.com> References: <975493.58414.qm@web58711.mail.re1.yahoo.com> Message-ID: Hey, Yeah, I think I have run into this before. The 'friends' call on a User actually calls '@session.post('facebook.friends.get')' So you always get the friends of the user for the current session. I kinda think it should blow up with an Exception. In order to be able to @source.friends_with?(@dest) you will need to have a facebook session setup for @source. Does that make sense? Am I following you? CC"ing the list so that all can enjoy. Dave On Feb 11, 2008 7:03 PM, William Thomas wrote: > > Hi Dave - thank you for the quick response! I appreciate you discussing this > with me and I hope that I don't have the wrong idea about how Facebooker is > supposed to work. > > Per bi-directional that is not exactly what I am saying. Is seems as though > both of those calls should return true, as we are both friends. Using the > pure api (in the test console) that is indeed what happens. > > I took a peek at the source code to Facebooker and saw that the > friends_with? calls "friends.map{|f| f.to_i}.include?(user_or_id.to_i) ". > This is fine when the source is the current session, but not so good when > the destination is not the current user. > > Here is a snippet of my code: > ________________________________ > src_id = params[:src_id] > > return if src_id.nil? || src_id.empty? > > @source = Facebooker::User.new(src_id) > @dest = @facebook_session.user > > @dest_to_src_are_friends = @dest.friends_with?(@source) > @src_to_dest_are_friends = @source.friends_with?(@dest) > > which yields the following in my view > > Source: Noah (friend) > Dest: Bill (me) > > Is source friends with dest? false > Is dest friends with source? true > ________________________________ > > > > > > ----- Original Message ---- > From: David Clements > To: Bill > Sent: Monday, February 11, 2008 2:24:15 PM > Subject: Re: Facebooker development > > Hey Bill, > > Facebooker is actively being developed. We are on our way to 1.0 and > Mike has a book coming out very soon. > > What do you mean by are_friends? not being bi-directional? Do you > have a session for each user and one returns true and the other > doesn't? > > Dave > > On Feb 11, 2008 6:37 AM, Bill wrote: > > Is this still being actively developed? I am at a point where I need to > decide between facebooker & rfacebook. I like the way that facebooker is > "more ruby" but have already found a bug (in are_friends? not being > bi-directional). I am capable of submitting patches, etc, but am wondering > if it is worth spending time on instead of rfacebook. > > > > > > > > Thanks, > > > > Bill > > > > > ________________________________ > Never miss a thing. Make Yahoo your homepage. From wthomas989 at yahoo.com Tue Feb 12 00:04:14 2008 From: wthomas989 at yahoo.com (William Thomas) Date: Mon, 11 Feb 2008 21:04:14 -0800 (PST) Subject: [Facebooker-talk] Facebooker development Message-ID: <533757.75237.qm@web58711.mail.re1.yahoo.com> Hello list! I hope this is an appropriate topic. I understand what is happening here and am not sure if there is an easy answer, especially given the four goals listed on the Readme. It seems as though there is a mismatch between the functionality the Facebook REST API provides and what Facebooker is attempting to do by "rubyist-ing" it. As I have not gone too deep with the Facebooker plugin as of yet this may be the only example but I believe it is a good one and something that warrants more discussion. The question I have is, should Facebooker provide all of the functionality that the Facebook REST api does? In this case, should you ensure that a call " user1.friends_with?(user2) " provides the same output as "friends.areFriends( user1, user2 ) "? Since Facebook allows you to swap user1 & user2 and get the same results I (personally) would expect the same from an API wrapper. If that is the case it may be as easy to fix as changing the method: def friends_with?(user_or_id) friends.map{|f| f.to_i}.include?(user_or_id.to_i) end TO def friends_with?(user_or_id) results = session.post('facebook.friends.areFriends', :uids1 => self.uid, :uids2=> user_or_id.to_i ) #ok , i decided i dont want to write the rest of this :) end ----- Original Message ---- From: David Clements To: William Thomas Cc: facebooker-talk at rubyforge.org Sent: Monday, February 11, 2008 9:23:21 PM Subject: Re: Facebooker development Hey, Yeah, I think I have run into this before. The 'friends' call on a User actually calls '@session.post('facebook.friends.get')' So you always get the friends of the user for the current session. I kinda think it should blow up with an Exception. In order to be able to @source.friends_with?(@dest) you will need to have a facebook session setup for @source. Does that make sense? Am I following you? CC"ing the list so that all can enjoy. Dave On Feb 11, 2008 7:03 PM, William Thomas wrote: > > Hi Dave - thank you for the quick response! I appreciate you discussing this > with me and I hope that I don't have the wrong idea about how Facebooker is > supposed to work. > > Per bi-directional that is not exactly what I am saying. Is seems as though > both of those calls should return true, as we are both friends. Using the > pure api (in the test console) that is indeed what happens. > > I took a peek at the source code to Facebooker and saw that the > friends_with? calls "friends.map{|f| f.to_i}.include?(user_or_id.to_i) ". > This is fine when the source is the current session, but not so good when > the destination is not the current user. > > Here is a snippet of my code: > ________________________________ > src_id = params[:src_id] > > return if src_id.nil? || src_id.empty? > > @source = Facebooker::User.new(src_id) > @dest = @facebook_session.user > > @dest_to_src_are_friends = @dest.friends_with?(@source) > @src_to_dest_are_friends = @source.friends_with?(@dest) > > which yields the following in my view > > Source: Noah (friend) > Dest: Bill (me) > > Is source friends with dest? false > Is dest friends with source? true > ________________________________ > > > > > > ----- Original Message ---- > From: David Clements > To: Bill > Sent: Monday, February 11, 2008 2:24:15 PM > Subject: Re: Facebooker development > > Hey Bill, > > Facebooker is actively being developed. We are on our way to 1.0 and > Mike has a book coming out very soon. > > What do you mean by are_friends? not being bi-directional? Do you > have a session for each user and one returns true and the other > doesn't? > > Dave > > On Feb 11, 2008 6:37 AM, Bill wrote: > > Is this still being actively developed? I am at a point where I need to > decide between facebooker & rfacebook. I like the way that facebooker is > "more ruby" but have already found a bug (in are_friends? not being > bi-directional). I am capable of submitting patches, etc, but am wondering > if it is worth spending time on instead of rfacebook. > > > > > > > > Thanks, > > > > Bill > > > > > ________________________________ > Never miss a thing. Make Yahoo your homepage. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080211/bd3462a0/attachment-0001.html From shanev at gmail.com Tue Feb 12 01:08:51 2008 From: shanev at gmail.com (Shane Vitarana) Date: Tue, 12 Feb 2008 00:08:51 -0600 Subject: [Facebooker-talk] Facebooker development In-Reply-To: <533757.75237.qm@web58711.mail.re1.yahoo.com> References: <533757.75237.qm@web58711.mail.re1.yahoo.com> Message-ID: <4ab757a40802112208l5c18d7a3wa3805af2ad0386db@mail.gmail.com> William- Facebooker aims to provide all the functionality of Facebook's API. I don't understand your concern though. user1.friends_with?(user2) should return the same result as user2.friends_with(user1), which maps directly to the Facebook call. Is there something I'm missing? I'm not sure what you mean by "rubyist-ing". We are returning objects instead of XML that you would have to manually parse. This would be the case if an API wrapper was well designed in any object oriented language. Shane On Feb 11, 2008 11:04 PM, William Thomas wrote: > > Hello list! I hope this is an appropriate topic. I understand what is > happening here and am not sure if there is an easy answer, especially given > the four goals listed on the Readme. > > It seems as though there is a mismatch between the functionality the > Facebook REST API provides and what Facebooker is attempting to do by > "rubyist-ing" it. As I have not gone too deep with the Facebooker plugin as > of yet this may be the only example but I believe it is a good one and > something that warrants more discussion. > > The question I have is, should Facebooker provide all of the functionality > that the Facebook REST api does? In this case, should you ensure that a call > " user1.friends_with?(user2) " provides the same output as > "friends.areFriends( user1, user2 ) "? Since Facebook allows you to swap > user1 & user2 and get the same results I (personally) would expect the same > from an API wrapper. > > If that is the case it may be as easy to fix as changing the method: > > def friends_with?(user_or_id) > > friends.map{|f| f.to_i}.include?(user_or_id.to_i) > end > > TO > > def friends_with?(user_or_id) > results = session.post('facebook.friends.areFriends', :uids1 => > self.uid, :uids2=> user_or_id.to_i ) > #ok , i decided i dont want to write the rest of this :) > end > > > ----- Original Message ---- > From: David Clements > > To: William Thomas > Cc: facebooker-talk at rubyforge.org > Sent: Monday, February 11, 2008 9:23:21 PM > Subject: Re: Facebooker development > > Hey, > > Yeah, I think I have run into this before. The 'friends' call on a > User actually calls > '@session.post('facebook.friends.get')' > > So you always get the friends of the user for the current session. I > kinda think it should blow up with an Exception. > > In order to be able to @source.friends_with?(@dest) you will need to > have a facebook session setup for @source. > > > Does that make sense? Am I following you? > > CC"ing the list so that all can enjoy. > > Dave > > > > > On Feb 11, 2008 7:03 PM, William Thomas wrote: > > > > Hi Dave - thank you for the quick response! I appreciate you discussing > this > > with me and I hope that I don't have the wrong idea about how Facebooker > is > > supposed to work. > > > > Per bi-directional that is not exactly what I am saying. Is seems as > though > > both of those calls should return true, as we are both friends. Using the > > pure api (in the test console) that is indeed what happens. > > > > I took a peek at the source code to Facebooker and saw that the > > friends_with? calls "friends.map{|f| f.to_i}.include?(user_or_id.to_i) ". > > This is fine when the source is the current session, but not so good when > > the destination is not the current user. > > > > Here is a snippet of my code: > > ________________________________ > > src_id = params[:src_id] > > > > return if src_id.nil? || src_id.empty? > > > > @source = Facebooker::User.new(src_id) > > @dest = @facebook_session.user > > > > @dest_to_src_are_friends = @dest.friends_with?(@source) > > @src_to_dest_are_friends = @source.friends_with?(@dest) > > > > which yields the following in my view > > > > Source: Noah (friend) > > Dest: Bill (me) > > > > Is source friends with dest? false > > Is dest friends with source? true > > ________________________________ > > > > > > > > > > > > ----- Original Message ---- > > From: David Clements > > To: Bill > > Sent: Monday, February 11, 2008 2:24:15 PM > > Subject: Re: Facebooker development > > > > Hey Bill, > > > > Facebooker is actively being developed. We are on our way to 1.0 and > > Mike has a book coming out very soon. > > > > What do you mean by are_friends? not being bi-directional? Do you > > have a session for each user and one returns true and the other > > doesn't? > > > > Dave > > > > On Feb 11, 2008 6:37 AM, Bill wrote: > > > Is this still being actively developed? I am at a point where I need to > > decide between facebooker & rfacebook. I like the way that facebooker is > > "more ruby" but have already found a bug (in are_friends? not being > > bi-directional). I am capable of submitting patches, etc, but am wondering > > if it is worth spending time on instead of rfacebook. > > > > > > > > > > > > Thanks, > > > > > > Bill > > > > > > > > > ________________________________ > > Never miss a thing. Make Yahoo your homepage. > > > ________________________________ > Looking for last minute shopping deals? Find them fast with Yahoo! Search. > _______________________________________________ > 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 From shanev at gmail.com Tue Feb 12 13:17:07 2008 From: shanev at gmail.com (Shane Vitarana) Date: Tue, 12 Feb 2008 12:17:07 -0600 Subject: [Facebooker-talk] Facebooker development In-Reply-To: <533757.75237.qm@web58711.mail.re1.yahoo.com> References: <533757.75237.qm@web58711.mail.re1.yahoo.com> Message-ID: <4ab757a40802121017o234504cr320a8fa45599d68f@mail.gmail.com> I think you want to be using session.check_friendship instead of user.friends_with?. # Given an array like: # [[userid, otheruserid], [yetanotherid, andanotherid]] # returns a Hash indicating friendship of those pairs: # {[userid, otheruserid] => true, [yetanotherid, andanotherid] => false} # if one of the Hash values is nil, it means the facebook platform's answer is "I don't know" def check_friendship(array_of_pairs_of_users) uids1 = [] uids2 = [] array_of_pairs_of_users.each do |pair| uids1 = pair.first uids2 = pair.last end post('facebook.friends.areFriends', :uids1 => uids1, :uids2 => uids2) end -Shane On Feb 11, 2008 11:04 PM, William Thomas wrote: > > Hello list! I hope this is an appropriate topic. I understand what is > happening here and am not sure if there is an easy answer, especially given > the four goals listed on the Readme. > > It seems as though there is a mismatch between the functionality the > Facebook REST API provides and what Facebooker is attempting to do by > "rubyist-ing" it. As I have not gone too deep with the Facebooker plugin as > of yet this may be the only example but I believe it is a good one and > something that warrants more discussion. > > The question I have is, should Facebooker provide all of the functionality > that the Facebook REST api does? In this case, should you ensure that a call > " user1.friends_with?(user2) " provides the same output as > "friends.areFriends( user1, user2 ) "? Since Facebook allows you to swap > user1 & user2 and get the same results I (personally) would expect the same > from an API wrapper. > > If that is the case it may be as easy to fix as changing the method: > > def friends_with?(user_or_id) > > friends.map{|f| f.to_i}.include?(user_or_id.to_i) > end > > TO > > def friends_with?(user_or_id) > results = session.post('facebook.friends.areFriends', :uids1 => > self.uid, :uids2=> user_or_id.to_i ) > #ok , i decided i dont want to write the rest of this :) > end > > > ----- Original Message ---- > From: David Clements > > To: William Thomas > Cc: facebooker-talk at rubyforge.org > Sent: Monday, February 11, 2008 9:23:21 PM > Subject: Re: Facebooker development > > Hey, > > Yeah, I think I have run into this before. The 'friends' call on a > User actually calls > '@session.post('facebook.friends.get')' > > So you always get the friends of the user for the current session. I > kinda think it should blow up with an Exception. > > In order to be able to @source.friends_with?(@dest) you will need to > have a facebook session setup for @source. > > > Does that make sense? Am I following you? > > CC"ing the list so that all can enjoy. > > Dave > > > > > On Feb 11, 2008 7:03 PM, William Thomas wrote: > > > > Hi Dave - thank you for the quick response! I appreciate you discussing > this > > with me and I hope that I don't have the wrong idea about how Facebooker > is > > supposed to work. > > > > Per bi-directional that is not exactly what I am saying. Is seems as > though > > both of those calls should return true, as we are both friends. Using the > > pure api (in the test console) that is indeed what happens. > > > > I took a peek at the source code to Facebooker and saw that the > > friends_with? calls "friends.map{|f| f.to_i}.include?(user_or_id.to_i) ". > > This is fine when the source is the current session, but not so good when > > the destination is not the current user. > > > > Here is a snippet of my code: > > ________________________________ > > src_id = params[:src_id] > > > > return if src_id.nil? || src_id.empty? > > > > @source = Facebooker::User.new(src_id) > > @dest = @facebook_session.user > > > > @dest_to_src_are_friends = @dest.friends_with?(@source) > > @src_to_dest_are_friends = @source.friends_with?(@dest) > > > > which yields the following in my view > > > > Source: Noah (friend) > > Dest: Bill (me) > > > > Is source friends with dest? false > > Is dest friends with source? true > > ________________________________ > > > > > > > > > > > > ----- Original Message ---- > > From: David Clements > > To: Bill > > Sent: Monday, February 11, 2008 2:24:15 PM > > Subject: Re: Facebooker development > > > > Hey Bill, > > > > Facebooker is actively being developed. We are on our way to 1.0 and > > Mike has a book coming out very soon. > > > > What do you mean by are_friends? not being bi-directional? Do you > > have a session for each user and one returns true and the other > > doesn't? > > > > Dave > > > > On Feb 11, 2008 6:37 AM, Bill wrote: > > > Is this still being actively developed? I am at a point where I need to > > decide between facebooker & rfacebook. I like the way that facebooker is > > "more ruby" but have already found a bug (in are_friends? not being > > bi-directional). I am capable of submitting patches, etc, but am wondering > > if it is worth spending time on instead of rfacebook. > > > > > > > > > > > > Thanks, > > > > > > Bill > > > > > > > > > ________________________________ > > Never miss a thing. Make Yahoo your homepage. > > > ________________________________ > Looking for last minute shopping deals? Find them fast with Yahoo! Search. > _______________________________________________ > 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 From heavysixer at gmail.com Tue Feb 12 13:40:25 2008 From: heavysixer at gmail.com (Heavy Sixer) Date: Tue, 12 Feb 2008 12:40:25 -0600 Subject: [Facebooker-talk] rSpec with Facebooker Message-ID: Is anyone using rSpec for their tests with Facebooker? If so is it working? I am about to integrate a new app into Facebook and all the tests are written in rSpec and not flexmock / mocha like the tests in Facebooker are. I am just looking for a potential list of gotchas and possibly some sample code ;-) Thanks! Mark From digidigo at gmail.com Tue Feb 12 19:34:44 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 12 Feb 2008 17:34:44 -0700 Subject: [Facebooker-talk] Anyone knows the length limits on feed stories? Message-ID: Hey all, I am getting this error code publishing and action. 346 API_EC_EDIT_FEED_BODY_LENGTH Feed story body is too long Looks like the limit is currently "200" , what do you guys think about putting validation into Facebooker for this kind of thing? So that it blows up right away. Dave From shanev at gmail.com Tue Feb 12 22:11:18 2008 From: shanev at gmail.com (Shane Vitarana) Date: Tue, 12 Feb 2008 21:11:18 -0600 Subject: [Facebooker-talk] ApplicationProperties calls Message-ID: <4ab757a40802121911k4277e97bv59b54fab2dd487ec@mail.gmail.com> Hey guys- I'm nearly done implementing the new ApplicationProperties calls. But I want to get feedback on how to include JSON support. We need to encode and decode JSON to properly handle these calls. I'm currenting using ActiveSupport's JSON implementation. For those of you using Facebooker as a Rails plugin, this will work great since ActiveSupport is included with Rails, but we need a fallback solution for people using just the gem without Rails. Including all of ActiveSupport to just support JSON seems overkill. Should we go ahead and make ActiveSupport a dependency on the gem, or is there a lighter-weight JSON library that will fit our needs? Another option is just to include our own JSON encoding/decoding without any dependencies. Thanks, Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From digidigo at gmail.com Tue Feb 12 23:04:06 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 12 Feb 2008 21:04:06 -0700 Subject: [Facebooker-talk] ApplicationProperties calls In-Reply-To: <4ab757a40802121911k4277e97bv59b54fab2dd487ec@mail.gmail.com> References: <4ab757a40802121911k4277e97bv59b54fab2dd487ec@mail.gmail.com> Message-ID: I vote for lighter weight. This project looks pretty active: http://rubyforge.org/projects/json Dave On Feb 12, 2008 8:11 PM, Shane Vitarana wrote: > Hey guys- > > I'm nearly done implementing the new ApplicationProperties calls. But > I want to get feedback on how to include JSON support. We need to > encode and decode JSON to properly handle these calls. I'm currenting > using ActiveSupport's JSON implementation. For those of you using > Facebooker as a Rails plugin, this will work great since ActiveSupport > is included with Rails, but we need a fallback solution for people > using just the gem without Rails. Including all of ActiveSupport to > just support JSON seems overkill. Should we go ahead and make > ActiveSupport a dependency on the gem, or is there a lighter-weight > JSON library that will fit our needs? Another option is just to > include our own JSON encoding/decoding without any dependencies. > > Thanks, > Shane > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From digidigo at gmail.com Wed Feb 13 00:46:56 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 12 Feb 2008 22:46:56 -0700 Subject: [Facebooker-talk] Facebooker Tutorial -- The App In-Reply-To: <7E499369-7F66-4A05-A8C7-E6FD71B2A154@yahoo.com> References: <7E499369-7F66-4A05-A8C7-E6FD71B2A154@yahoo.com> Message-ID: Thanks Joel for the feedback, I made the changes you suggested and added another lesson. I am going to try and add one a day. As for the before_filter thing. I was on rails 1.2 up until a couple of weeks ago and I didn't need to do what you mentioned. And looking at the Facebooker code, it does exactly what you are doing manually def ensure_application_is_installed_by_facebook_user(options = {}) before_filter :ensure_application_is_installed_by_facebook_user, options end I wonder what is going on there. Dave On Feb 11, 2008 7:19 PM, Joel Nylund wrote: > Dave, > > this is awesome! I wish I had it a few weeks ago when I was starting > Facebooker! Very Cool! > > Couple small things: > - invite your friends skip button doesn't go anywhere for me. (didnt > know if there was another tutorial) > - missing 'e' on your text next the users at top of invite friends > ("th users") > > also, im not sure if its a rails 2 thing or what (and maybe some of > the gurus on this list can enlighten me) , but in rails 1.2, I had to > add an actual before_filter to add an :except clause. Im not sure the > diff between: > > ensure_authenticated_to_facebook [:except => 'add_facebook_application'] > > and > > before_filter :ensure_authenticated_to_facebook [:except => > 'add_facebook_application'] > > > Joel > > > > On Feb 11, 2008, at 6:31 PM, David Clements wrote: > > > Hey All, > > > > I have been working on a a Facebooker Tutorial application. The main > > idea is to take all these code snippets that I create answering > > questions, or testing out functionality and wrap them up into mini > > lessons. All the code examples in the tutorial are live and come > > direct from the file system. What I have so far is just the start, I > > have another 10 - 15 examples on my filesystem that I need to pull > > together. > > > > I would love some feedback if anyone has any time. > > > > http://apps.facebook.com/facebooker_tutorial/ > > > > Don't worry you don't have to invite 20 friends to check it out, :) > > > > Thanks, > > > > Dave > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > From shanev at gmail.com Wed Feb 13 14:02:33 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 13 Feb 2008 13:02:33 -0600 Subject: [Facebooker-talk] ApplicationProperties calls In-Reply-To: References: <4ab757a40802121911k4277e97bv59b54fab2dd487ec@mail.gmail.com> Message-ID: <4ab757a40802131102s2dda5d64kda26feeaa4bb71c3@mail.gmail.com> Thanks guys. I actually looked at that gem first, but its interface didn't seem as simple as ActiveSupport's, but I'll give it a second look. Shane On Feb 13, 2008 12:26 PM, Andrew Grim wrote: > The json gem is bad-ass, and it's core is in C, so it's much faster than > rails' JSON implementation. Also, it fully follows the JSON spec while the > rails version has some inconsistencies, last I checked anyway. > > > > On Feb 12, 2008 8:04 PM, David Clements wrote: > > I vote for lighter weight. > > > > This project looks pretty active: > > > > http://rubyforge.org/projects/json > > > > Dave > > > > > > > > > > On Feb 12, 2008 8:11 PM, Shane Vitarana wrote: > > > Hey guys- > > > > > > I'm nearly done implementing the new ApplicationProperties calls. But > > > I want to get feedback on how to include JSON support. We need to > > > encode and decode JSON to properly handle these calls. I'm currenting > > > using ActiveSupport's JSON implementation. For those of you using > > > Facebooker as a Rails plugin, this will work great since ActiveSupport > > > is included with Rails, but we need a fallback solution for people > > > using just the gem without Rails. Including all of ActiveSupport to > > > just support JSON seems overkill. Should we go ahead and make > > > ActiveSupport a dependency on the gem, or is there a lighter-weight > > > JSON library that will fit our needs? Another option is just to > > > include our own JSON encoding/decoding without any dependencies. > > > > > > Thanks, > > > Shane > > > > > > -- > > > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > > > _______________________________________________ > > > Facebooker-talk mailing list > > > Facebooker-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > _______________________________________________ > > 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 From wil at 3cglabs.com Wed Feb 13 18:37:18 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Wed, 13 Feb 2008 17:37:18 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos Message-ID: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> Hi all, I just started working with facebooker, and though documentation is scarce, the code has been clean enough for me to follow along and figure things out. I have two questions: 1) Where/how does one submit a patch? I checked around the history of the mailing list, and I didn't see any offhand searching for /submit (patch)?/ I have a minor patch to allow uploading of photos in a single function call. I've followed convention and stuck it by the get_photos() and get_albums() in sessions.rb, as I don't know where else it would be better suited. Please let me know how/where I can submit patches. 2) It took me a while to find the get_photos call in Facebooker::Session. I had intuitively thought that I'd be able to get an album's photos like: facebook_session.user.albums[0].photos # => gives an array of Facebooker::Photo but instead, one must do: aid = facebook_session.user.albums.first.aid facebook_session.get_photos(nil, nil, aid) Is there a reason for that? I'm just wondering if the former would be better? Thanks. Wilhelm -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com From mmangino at elevatedrails.com Wed Feb 13 18:44:26 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Wed, 13 Feb 2008 17:44:26 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> Message-ID: Wilhelm, You can either send patches to the Rubyforge page, or even better, send them to the list. I'd love to see both of your patches. Mike On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > Hi all, > > I just started working with facebooker, and though documentation is > scarce, the code has been clean enough for me to follow along and > figure things out. I have two questions: > > 1) Where/how does one submit a patch? I checked around the history of > the mailing list, and I didn't see any offhand searching for /submit > (patch)?/ > > I have a minor patch to allow uploading of photos in a single function > call. I've followed convention and stuck it by the get_photos() and > get_albums() in sessions.rb, as I don't know where else it would be > better suited. > > Please let me know how/where I can submit patches. > > 2) It took me a while to find the get_photos call in > Facebooker::Session. I had intuitively thought that I'd be able to > get an album's photos like: > > facebook_session.user.albums[0].photos # => gives an array of > Facebooker::Photo > > but instead, one must do: > > aid = facebook_session.user.albums.first.aid > facebook_session.get_photos(nil, nil, aid) > > Is there a reason for that? I'm just wondering if the former would be > better? Thanks. > > Wilhelm > > -- > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From wil at 3cglabs.com Wed Feb 13 23:15:22 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Wed, 13 Feb 2008 22:15:22 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> Message-ID: <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> Here is the first one. It was a diff of lib/facebooker/session.rb r172. I didn't know where else to stick upload_photo() other than by get_photos(). If there's a better place for it, by all means, move it. Should I have written tests and documentation for it? I saw multipart file posting in the tests, so I figured upload_photo probably works...? Wilhelm On Feb 13, 2008 5:44 PM, Mike Mangino wrote: > Wilhelm, > > You can either send patches to the Rubyforge page, or even better, > send them to the list. > > I'd love to see both of your patches. > > Mike > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > Hi all, > > > > I just started working with facebooker, and though documentation is > > scarce, the code has been clean enough for me to follow along and > > figure things out. I have two questions: > > > > 1) Where/how does one submit a patch? I checked around the history of > > the mailing list, and I didn't see any offhand searching for /submit > > (patch)?/ > > > > I have a minor patch to allow uploading of photos in a single function > > call. I've followed convention and stuck it by the get_photos() and > > get_albums() in sessions.rb, as I don't know where else it would be > > better suited. > > > > Please let me know how/where I can submit patches. > > > > 2) It took me a while to find the get_photos call in > > Facebooker::Session. I had intuitively thought that I'd be able to > > get an album's photos like: > > > > facebook_session.user.albums[0].photos # => gives an array of > > Facebooker::Photo > > > > but instead, one must do: > > > > aid = facebook_session.user.albums.first.aid > > facebook_session.get_photos(nil, nil, aid) > > > > Is there a reason for that? I'm just wondering if the former would be > > better? Thanks. > > > > Wilhelm > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com -------------- next part -------------- A non-text attachment was scrubbed... Name: facebooker_upload_photos.patch Type: text/x-patch Size: 817 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080213/c8ca9fb5/attachment.bin From shanev at gmail.com Thu Feb 14 02:08:39 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 01:08:39 -0600 Subject: [Facebooker-talk] New features: Application properties and cookies Message-ID: <4ab757a40802132308j12199267ta35ef1798873a020@mail.gmail.com> Hey guys- Two new features: Set/get app properties like this: properties = { :application_name => "Video Jukebox", :default_fbml => "blah" } facebook_session.admin.set_app_properties(properties) properties = facebook_session.admin.get_app_properties(:application_name, :default_fbml) Set/get cookies: facebook_session.data.set_cookie(uid, 'name', 'value') facebook_session.data.get_cookies(uid) Let me know if there are any issues. -Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From wil at 3cglabs.com Thu Feb 14 11:14:12 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Thu, 14 Feb 2008 10:14:12 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> Message-ID: <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> Here is the second. I added upload_photo() and photos() to the Album class, along with a simple initialization to get the session set. It's not as flexible as User, so it currently only uses the current session. So now, one can do this to get an album's photos facebook_session.user.albums[0].photos And this to upload to that album facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", "new sunset photo") They currently both depend on get_photos() and upload_photo() to be in the Session object. Please review the patch. On another note, I wasn't able to run the tests. I can't find flexmock anywhere. Where would this be? /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- flexmock/test_unit (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from ./test/test_helper.rb:3 from -e:1:in `require' from -e:1 rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung wrote: > Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > I didn't know where else to stick upload_photo() other than by > get_photos(). If there's a better place for it, by all means, move > it. > > Should I have written tests and documentation for it? I saw multipart > file posting in the tests, so I figured upload_photo probably > works...? > > Wilhelm > > > > On Feb 13, 2008 5:44 PM, Mike Mangino wrote: > > Wilhelm, > > > > You can either send patches to the Rubyforge page, or even better, > > send them to the list. > > > > I'd love to see both of your patches. > > > > Mike > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > Hi all, > > > > > > I just started working with facebooker, and though documentation is > > > scarce, the code has been clean enough for me to follow along and > > > figure things out. I have two questions: > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > the mailing list, and I didn't see any offhand searching for /submit > > > (patch)?/ > > > > > > I have a minor patch to allow uploading of photos in a single function > > > call. I've followed convention and stuck it by the get_photos() and > > > get_albums() in sessions.rb, as I don't know where else it would be > > > better suited. > > > > > > Please let me know how/where I can submit patches. > > > > > > 2) It took me a while to find the get_photos call in > > > Facebooker::Session. I had intuitively thought that I'd be able to > > > get an album's photos like: > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > Facebooker::Photo > > > > > > but instead, one must do: > > > > > > aid = facebook_session.user.albums.first.aid > > > facebook_session.get_photos(nil, nil, aid) > > > > > > Is there a reason for that? I'm just wondering if the former would be > > > better? Thanks. > > > > > > Wilhelm > > > > > > -- > > > http://webjazz.blogspot.com > > > http://www.mobtropolis.com > > > http://www.3cglabs.com > > > _______________________________________________ > > > Facebooker-talk mailing list > > > Facebooker-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > -- > > Mike Mangino > > http://www.elevatedrails.com > > > > > > > > -- > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com From wil at 3cglabs.com Thu Feb 14 11:15:11 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Thu, 14 Feb 2008 10:15:11 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> Message-ID: <4cdd0d160802140815g6cea47cexb65e80c7921d1eaf@mail.gmail.com> Apologies for forgetting the attachment. Here it is. On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung wrote: > Here is the second. I added upload_photo() and photos() to the Album > class, along with a simple initialization to get the session set. > It's not as flexible as User, so it currently only uses the current > session. > > So now, one can do this to get an album's photos > > facebook_session.user.albums[0].photos > > And this to upload to that album > facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", > "new sunset photo") > > They currently both depend on get_photos() and upload_photo() to be in > the Session object. Please review the patch. > > On another note, I wasn't able to run the tests. I can't find > flexmock anywhere. Where would this be? > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- flexmock/test_unit > (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from ./test/test_helper.rb:3 > from -e:1:in `require' > from -e:1 > rake aborted! > Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] > > > > On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung wrote: > > Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > > > I didn't know where else to stick upload_photo() other than by > > get_photos(). If there's a better place for it, by all means, move > > it. > > > > Should I have written tests and documentation for it? I saw multipart > > file posting in the tests, so I figured upload_photo probably > > works...? > > > > Wilhelm > > > > > > > > On Feb 13, 2008 5:44 PM, Mike Mangino wrote: > > > Wilhelm, > > > > > > You can either send patches to the Rubyforge page, or even better, > > > send them to the list. > > > > > > I'd love to see both of your patches. > > > > > > Mike > > > > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > > > Hi all, > > > > > > > > I just started working with facebooker, and though documentation is > > > > scarce, the code has been clean enough for me to follow along and > > > > figure things out. I have two questions: > > > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > > the mailing list, and I didn't see any offhand searching for /submit > > > > (patch)?/ > > > > > > > > I have a minor patch to allow uploading of photos in a single function > > > > call. I've followed convention and stuck it by the get_photos() and > > > > get_albums() in sessions.rb, as I don't know where else it would be > > > > better suited. > > > > > > > > Please let me know how/where I can submit patches. > > > > > > > > 2) It took me a while to find the get_photos call in > > > > Facebooker::Session. I had intuitively thought that I'd be able to > > > > get an album's photos like: > > > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > > Facebooker::Photo > > > > > > > > but instead, one must do: > > > > > > > > aid = facebook_session.user.albums.first.aid > > > > facebook_session.get_photos(nil, nil, aid) > > > > > > > > Is there a reason for that? I'm just wondering if the former would be > > > > better? Thanks. > > > > > > > > Wilhelm > > > > > > > > -- > > > > http://webjazz.blogspot.com > > > > http://www.mobtropolis.com > > > > http://www.3cglabs.com > > > > _______________________________________________ > > > > Facebooker-talk mailing list > > > > Facebooker-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > > > Mike Mangino > > > http://www.elevatedrails.com > > > > > > > > > > > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > > > > > -- > > > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com -------------- next part -------------- A non-text attachment was scrubbed... Name: facebooker_add_photos_to_album.patch Type: text/x-patch Size: 915 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080214/2cdd0197/attachment.bin From ri at niculo.us Thu Feb 14 14:36:15 2008 From: ri at niculo.us (Nicholaus Ames) Date: Thu, 14 Feb 2008 11:36:15 -0800 Subject: [Facebooker-talk] redirect_to still broken? Message-ID: I saw that back in Jan there was a bug with the redirect_to. The thread ended with no resolution. Anybody know whats up with that? Not sure if my problem is the same but below is my error log: NoMethodError (undefined method `symbol_url' for #): /vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:27:in `send!' /vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:27:in `polymorphic_url' /vendor/rails/actionpack/lib/action_controller/base.rb:618:in `url_for' /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:129:in `fbml_redirect_tag' /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:122:in `redirect_to' /app/controllers/wants_controller.rb:6:in `index' /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send' -- Nicholaus Ames 503-544-5813 ri.niculo.us From shanev at gmail.com Thu Feb 14 14:50:49 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 13:50:49 -0600 Subject: [Facebooker-talk] redirect_to still broken? In-Reply-To: References: Message-ID: <4ab757a40802141150nda64ec8j4d4e96a139c29861@mail.gmail.com> The facebooker version of redirect_to doesn't work with polymorphic routes yet. For now use the full url. It'll be great if someone can come up with a patch. Right now we just pass along the args to the fbml redirect tag, assuming it is a url. Shane On Thu, Feb 14, 2008 at 1:36 PM, Nicholaus Ames wrote: > I saw that back in Jan there was a bug with the redirect_to. The > thread ended with no resolution. Anybody know whats up with that? > Not sure if my problem is the same but below is my error log: > > NoMethodError (undefined method `symbol_url' for #): > /vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:27:in > `send!' > /vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:27:in > `polymorphic_url' > /vendor/rails/actionpack/lib/action_controller/base.rb:618:in `url_for' > /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:129:in > `fbml_redirect_tag' > /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:122:in > `redirect_to' > /app/controllers/wants_controller.rb:6:in `index' > /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send' > > -- > Nicholaus Ames > 503-544-5813 > ri.niculo.us > _______________________________________________ > 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 From brian at hwrd.com Thu Feb 14 15:09:42 2008 From: brian at hwrd.com (Brian Howenstein) Date: Thu, 14 Feb 2008 15:09:42 -0500 Subject: [Facebooker-talk] RESTful Delete Message-ID: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> I sent this question out about a week ago, but never got a response... I have so far been unable to do a RESTful delete using Facebooker. In my config/routes.rb, I have: map.resources :runs I am trying to do the delete using: <%= link_to "Delete", run, :method => :delete %> However, instead of doing the 'delete', it calls the 'show' action. Has anyone been successful doing a RESTful delete using Facebooker? Thanks, Brian From jbresnik at gmail.com Thu Feb 14 15:44:54 2008 From: jbresnik at gmail.com (John Bresnik) Date: Thu, 14 Feb 2008 12:44:54 -0800 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> Message-ID: <3b8cec990802141244x7270dc23w390206e6ef749b9f@mail.gmail.com> I know the FB Data Store API supports RESTful deletes but does the regular API support it? On Thu, Feb 14, 2008 at 12:09 PM, Brian Howenstein wrote: > I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the 'delete', it calls the 'show' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From shanev at gmail.com Thu Feb 14 15:45:35 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 14:45:35 -0600 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> Message-ID: <4ab757a40802141245r797692d8qb3e521c2486ae938@mail.gmail.com> Brian- Is this a link to a canvas page or an action on your callback server? Can you try link_to with either :canvas => true or :canvas => false and see if it works? Shane On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein wrote: > I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the 'delete', it calls the 'show' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > 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 From brian at hwrd.com Thu Feb 14 17:02:13 2008 From: brian at hwrd.com (Brian Howenstein) Date: Thu, 14 Feb 2008 17:02:13 -0500 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <4ab757a40802141245r797692d8qb3e521c2486ae938@mail.gmail.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> <4ab757a40802141245r797692d8qb3e521c2486ae938@mail.gmail.com> Message-ID: <2BE43D35-DD40-4792-B19D-29F26D745362@hwrd.com> Hi Shane, I tried both ways with identical results to my original message. I am trying to call a normal REST 'destroy' action in my controller from a canvas page: # DELETE /runs/1 # DELETE /runs/1.xml def destroy @run = Run.find(params[:id]) @run.destroy respond_to do |format| format.html { redirect_to(runs_url) } format.fbml { redirect_to(runs_url) } format.xml { head :ok } end It appears that it is trying to do a POST to /runs/1 when it should be doing a DELETE to /runs/1. Since it is doing a POST, it looks to be calling the 'show' action instead of the 'destroy' action. Any ideas? Thanks, Brian On Feb 14, 2008, at 3:45 PM, Shane Vitarana wrote: > Brian- > > Is this a link to a canvas page or an action on your callback server? > Can you try link_to with either :canvas => true or :canvas => false > and see if it works? > > Shane > > On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein > wrote: >> I sent this question out about a week ago, but never got a >> response... >> >> I have so far been unable to do a RESTful delete using Facebooker. >> >> In my config/routes.rb, I have: >> >> map.resources :runs >> >> I am trying to do the delete using: >> >> <%= link_to "Delete", run, :method => :delete %> >> >> However, instead of doing the 'delete', it calls the 'show' action. >> >> Has anyone been successful doing a RESTful delete using Facebooker? >> >> Thanks, >> Brian >> _______________________________________________ >> 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 From mmangino at elevatedrails.com Thu Feb 14 17:04:40 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 14 Feb 2008 16:04:40 -0600 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> Message-ID: <9CA43525-8B13-47FA-9152-2046028E138F@elevatedrails.com> What source gets generated by that? Is it using Prototype to build a form on demand? If so, that won't work since prototype doesn't work via FBJS. I'm slowly but surely working on replacing prototype functionality inside facebook with working FBJS. I'd love some help with that. Mike On Feb 14, 2008, at 2:09 PM, Brian Howenstein wrote: > I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the 'delete', it calls the 'show' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From shanev at gmail.com Thu Feb 14 17:10:51 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 16:10:51 -0600 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <9CA43525-8B13-47FA-9152-2046028E138F@elevatedrails.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> <9CA43525-8B13-47FA-9152-2046028E138F@elevatedrails.com> Message-ID: <4ab757a40802141410o73669648g1bf992c639287606@mail.gmail.com> Mike- It'll be great to have an FBJS version of Prototype (and possibly JQuery). David Newbury already has a FBJS version of getElementsByClassName that we can contribute. Shane On Thu, Feb 14, 2008 at 4:04 PM, Mike Mangino wrote: > What source gets generated by that? Is it using Prototype to build a > form on demand? If so, that won't work since prototype doesn't work > via FBJS. > > I'm slowly but surely working on replacing prototype functionality > inside facebook with working FBJS. I'd love some help with that. > > Mike > > > > On Feb 14, 2008, at 2:09 PM, Brian Howenstein wrote: > > > I sent this question out about a week ago, but never got a response... > > > > I have so far been unable to do a RESTful delete using Facebooker. > > > > In my config/routes.rb, I have: > > > > map.resources :runs > > > > I am trying to do the delete using: > > > > <%= link_to "Delete", run, :method => :delete %> > > > > However, instead of doing the 'delete', it calls the 'show' action. > > > > Has anyone been successful doing a RESTful delete using Facebooker? > > > > Thanks, > > Brian > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > > > _______________________________________________ > 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 From shanev at gmail.com Thu Feb 14 18:23:07 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 17:23:07 -0600 Subject: [Facebooker-talk] Notifications per day Message-ID: <4ab757a40802141523r40d1ae40r79b14e03c3426562@mail.gmail.com> I added a method to get the number of notifications your app is allowed per day. facebook_session.admin.get_allocation(:notifications_per_day) Right now it will always return 40, until Facebook starts calculating it based on the spaminess of your app. Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From shanev at gmail.com Thu Feb 14 23:47:59 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 14 Feb 2008 22:47:59 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> Message-ID: <4ab757a40802142047i3a058276j7e9acb65566ab5d4@mail.gmail.com> gem install flexmock I haven't seen the patch yet but I like the idea of having convenience behavior methods on the models that make them easier to use, so you don't have to directly use session all the time. Shane On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung wrote: > Here is the second. I added upload_photo() and photos() to the Album > class, along with a simple initialization to get the session set. > It's not as flexible as User, so it currently only uses the current > session. > > So now, one can do this to get an album's photos > > facebook_session.user.albums[0].photos > > And this to upload to that album > facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", > "new sunset photo") > > They currently both depend on get_photos() and upload_photo() to be in > the Session object. Please review the patch. > > On another note, I wasn't able to run the tests. I can't find > flexmock anywhere. Where would this be? > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- flexmock/test_unit > (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from ./test/test_helper.rb:3 > from -e:1:in `require' > from -e:1 > rake aborted! > Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] > > > > On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung wrote: > > Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > > > I didn't know where else to stick upload_photo() other than by > > get_photos(). If there's a better place for it, by all means, move > > it. > > > > Should I have written tests and documentation for it? I saw multipart > > file posting in the tests, so I figured upload_photo probably > > works...? > > > > Wilhelm > > > > > > > > On Feb 13, 2008 5:44 PM, Mike Mangino wrote: > > > Wilhelm, > > > > > > You can either send patches to the Rubyforge page, or even better, > > > send them to the list. > > > > > > I'd love to see both of your patches. > > > > > > Mike > > > > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > > > Hi all, > > > > > > > > I just started working with facebooker, and though documentation is > > > > scarce, the code has been clean enough for me to follow along and > > > > figure things out. I have two questions: > > > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > > the mailing list, and I didn't see any offhand searching for /submit > > > > (patch)?/ > > > > > > > > I have a minor patch to allow uploading of photos in a single function > > > > call. I've followed convention and stuck it by the get_photos() and > > > > get_albums() in sessions.rb, as I don't know where else it would be > > > > better suited. > > > > > > > > Please let me know how/where I can submit patches. > > > > > > > > 2) It took me a while to find the get_photos call in > > > > Facebooker::Session. I had intuitively thought that I'd be able to > > > > get an album's photos like: > > > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > > Facebooker::Photo > > > > > > > > but instead, one must do: > > > > > > > > aid = facebook_session.user.albums.first.aid > > > > facebook_session.get_photos(nil, nil, aid) > > > > > > > > Is there a reason for that? I'm just wondering if the former would be > > > > better? Thanks. > > > > > > > > Wilhelm > > > > > > > > -- > > > > http://webjazz.blogspot.com > > > > http://www.mobtropolis.com > > > > http://www.3cglabs.com > > > > _______________________________________________ > > > > Facebooker-talk mailing list > > > > Facebooker-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > > > Mike Mangino > > > http://www.elevatedrails.com > > > > > > > > > > > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > > > > > -- > > > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > _______________________________________________ > 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 From mniessner at elevatedrails.com Fri Feb 15 10:06:56 2008 From: mniessner at elevatedrails.com (Michael Niessner) Date: Fri, 15 Feb 2008 09:06:56 -0600 Subject: [Facebooker-talk] Submitting patches to facebooker and uploading photos In-Reply-To: <4ab757a40802142047i3a058276j7e9acb65566ab5d4@mail.gmail.com> References: <4cdd0d160802131537i7d001e68w25f6111ca53d64fb@mail.gmail.com> <4cdd0d160802132015o78eeb20asf5e97d6c2d58018e@mail.gmail.com> <4cdd0d160802140814q258af738n790e7f09ad1285e4@mail.gmail.com> <4ab757a40802142047i3a058276j7e9acb65566ab5d4@mail.gmail.com> Message-ID: I don't think it is a great idea to hardcode the content type to image/ jpg, as facebook will let you upload other file types and convert them to jpeg's for you. Perhaps it would make more sense just to add optional aid, and caption fields to the exsiting User#upload_photo. And then have Album#upload_photo defer to that. Michael On Feb 14, 2008, at 10:47 PM, Shane Vitarana wrote: > gem install flexmock > > I haven't seen the patch yet but I like the idea of having convenience > behavior methods on the models that make them easier to use, so you > don't have to directly use session all the time. > > Shane > > On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung > wrote: >> Here is the second. I added upload_photo() and photos() to the Album >> class, along with a simple initialization to get the session set. >> It's not as flexible as User, so it currently only uses the current >> session. >> >> So now, one can do this to get an album's photos >> >> facebook_session.user.albums[0].photos >> >> And this to upload to that album >> facebook_session.user.albums[0].upload_photo("public/images/ >> sunset.jpg", >> "new sunset photo") >> >> They currently both depend on get_photos() and upload_photo() to be >> in >> the Session object. Please review the patch. >> >> On another note, I wasn't able to run the tests. I can't find >> flexmock anywhere. Where would this be? >> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require': no such file to load -- flexmock/test_unit >> (LoadError) >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: >> 27:in >> `require' >> from ./test/test_helper.rb:3 >> from -e:1:in `require' >> from -e:1 >> rake aborted! >> Command failed with status (1): [/usr/bin/ruby1.8 -w - >> Ilib:ext:bin:test -e ...] >> >> >> >> On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung >> wrote: >>> Here is the first one. It was a diff of lib/facebooker/session.rb >>> r172. >>> >>> I didn't know where else to stick upload_photo() other than by >>> get_photos(). If there's a better place for it, by all means, move >>> it. >>> >>> Should I have written tests and documentation for it? I saw >>> multipart >>> file posting in the tests, so I figured upload_photo probably >>> works...? >>> >>> Wilhelm >>> >>> >>> >>> On Feb 13, 2008 5:44 PM, Mike Mangino >>> wrote: >>>> Wilhelm, >>>> >>>> You can either send patches to the Rubyforge page, or even better, >>>> send them to the list. >>>> >>>> I'd love to see both of your patches. >>>> >>>> Mike >>>> >>>> >>>> On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: >>>> >>>>> Hi all, >>>>> >>>>> I just started working with facebooker, and though documentation >>>>> is >>>>> scarce, the code has been clean enough for me to follow along and >>>>> figure things out. I have two questions: >>>>> >>>>> 1) Where/how does one submit a patch? I checked around the >>>>> history of >>>>> the mailing list, and I didn't see any offhand searching for / >>>>> submit >>>>> (patch)?/ >>>>> >>>>> I have a minor patch to allow uploading of photos in a single >>>>> function >>>>> call. I've followed convention and stuck it by the get_photos() >>>>> and >>>>> get_albums() in sessions.rb, as I don't know where else it would >>>>> be >>>>> better suited. >>>>> >>>>> Please let me know how/where I can submit patches. >>>>> >>>>> 2) It took me a while to find the get_photos call in >>>>> Facebooker::Session. I had intuitively thought that I'd be able >>>>> to >>>>> get an album's photos like: >>>>> >>>>> facebook_session.user.albums[0].photos # => gives an array of >>>>> Facebooker::Photo >>>>> >>>>> but instead, one must do: >>>>> >>>>> aid = facebook_session.user.albums.first.aid >>>>> facebook_session.get_photos(nil, nil, aid) >>>>> >>>>> Is there a reason for that? I'm just wondering if the former >>>>> would be >>>>> better? Thanks. >>>>> >>>>> Wilhelm >>>>> >>>>> -- >>>>> http://webjazz.blogspot.com >>>>> http://www.mobtropolis.com >>>>> http://www.3cglabs.com >>>>> _______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> -- >>>> Mike Mangino >>>> http://www.elevatedrails.com >>>> >>>> >>> >>> >>> >>> -- >>> http://webjazz.blogspot.com >>> http://www.mobtropolis.com >>> http://www.3cglabs.com >>> >> >> >> >> -- >> >> >> http://webjazz.blogspot.com >> http://www.mobtropolis.com >> http://www.3cglabs.com >> _______________________________________________ >> 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 > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From mmangino at elevatedrails.com Fri Feb 15 13:14:28 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 15 Feb 2008 12:14:28 -0600 Subject: [Facebooker-talk] New addition to Facebooker: Publisher Message-ID: <5AEDF388-31B2-4EFE-878B-3BDB5F3B3448@elevatedrails.com> I just added a class that is similar to ActionMailer for publishing Facebook feeds and notifications. The documentation is at http://facebooker.rubyforge.org/ (http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html in particular) Not only does it let you do things like TestPublisher.deliver_app_add_action(@user) but it also makes view and routing helpers available to you. Let me know what you think. Mike -- Mike Mangino http://www.elevatedrails.com From matthieu.ruiz at gmail.com Fri Feb 15 14:25:08 2008 From: matthieu.ruiz at gmail.com (Matthieu Ruiz) Date: Fri, 15 Feb 2008 20:25:08 +0100 Subject: [Facebooker-talk] "fields_for" and "facebook_form_for" helpers... Message-ID: Hi, I try to learn how to use facebooker plugin. I would like to edit *multiple models in one form* that's why I use "field_for" helper. Unfortunately, it does not react as "facebook_form_for" since is does not create an context. Furthermore, It does not work even though I put a "fields_for" within a "facebook_form_for" scope. Is there a way to use the standard rails form helpers, converted into the facebook specific version, within a "fields_for" as it is done within a "facebook_form_for". Thanks a lot for your help Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080215/247ffcf2/attachment.html From mmangino at elevatedrails.com Fri Feb 15 14:49:27 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 15 Feb 2008 13:49:27 -0600 Subject: [Facebooker-talk] "fields_for" and "facebook_form_for" helpers... In-Reply-To: References: Message-ID: I think you can just pass in :builder=>Facebooker::Rails::FacebookFormBuilder Mike On Feb 15, 2008, at 1:25 PM, Matthieu Ruiz wrote: > Hi, > > I try to learn how to use facebooker plugin. > I would like to edit *multiple models in one form* that's why I use > "field_for" helper. > Unfortunately, it does not react as "facebook_form_for" since is > does not create an context. Furthermore, It does not > work even though I put a "fields_for" within a "facebook_form_for" > scope. > > Is there a way to use the standard rails form helpers, converted > into the facebook specific version, within a "fields_for" as it is > done within a "facebook_form_for". > > Thanks a lot for your help > > Matt > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From svicalifornia at gmail.com Fri Feb 15 14:54:54 2008 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Fri, 15 Feb 2008 11:54:54 -0800 Subject: [Facebooker-talk] Execute on creation of FB session Message-ID: <20080215115454796297.e57fc624@gmail.com> Is there a way to specify a method to be invoked when an FB session is created? I'd like to cache certain user/friend info when the user starts a new session with the app, and then not call the caching function again on existing sessions. Shawn From matthieu.ruiz at gmail.com Fri Feb 15 15:11:45 2008 From: matthieu.ruiz at gmail.com (Matthieu Ruiz) Date: Fri, 15 Feb 2008 21:11:45 +0100 Subject: [Facebooker-talk] "fields_for" and "facebook_form_for" helpers... In-Reply-To: References: Message-ID: It works, thanks ! :) Matt On Fri, Feb 15, 2008 at 8:49 PM, Mike Mangino wrote: > I think you can just pass > in :builder=>Facebooker::Rails::FacebookFormBuilder > > Mike > > On Feb 15, 2008, at 1:25 PM, Matthieu Ruiz wrote: > > > Hi, > > > > I try to learn how to use facebooker plugin. > > I would like to edit *multiple models in one form* that's why I use > > "field_for" helper. > > Unfortunately, it does not react as "facebook_form_for" since is > > does not create an context. Furthermore, It does not > > work even though I put a "fields_for" within a "facebook_form_for" > > scope. > > > > Is there a way to use the standard rails form helpers, converted > > into the facebook specific version, within a "fields_for" as it is > > done within a "facebook_form_for". > > > > Thanks a lot for your help > > > > Matt > > > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080215/221548f8/attachment.html From jnylund at yahoo.com Fri Feb 15 14:32:25 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Fri, 15 Feb 2008 14:32:25 -0500 Subject: [Facebooker-talk] "fields_for" and "facebook_form_for" helpers... In-Reply-To: References: Message-ID: not that I know of, but you can use traditional helpers and surround them manually in the fbeditor markup, not beautiful but it will work with multiple models. <%=datetime_select :task, :duedate,:order => [:month,:day,:year],:twelve_hour => true,:minute_step => 15, :use_short_month => true %> I put a bunch of form examples in my blog a while back: http://jnylund.typepad.com/joels_blog/2008/02/facebooker-form.html Joel On Feb 15, 2008, at 2:25 PM, Matthieu Ruiz wrote: > Hi, > > I try to learn how to use facebooker plugin. > I would like to edit *multiple models in one form* that's why I use > "field_for" helper. > Unfortunately, it does not react as "facebook_form_for" since is > does not create an context. Furthermore, It does not > work even though I put a "fields_for" within a "facebook_form_for" > scope. > > Is there a way to use the standard rails form helpers, converted > into the facebook specific version, within a "fields_for" as it is > done within a "facebook_form_for". > > Thanks a lot for your help > > Matt > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From dustin at dustinanderson.com Fri Feb 15 23:22:25 2008 From: dustin at dustinanderson.com (Dustin Anderson) Date: Fri, 15 Feb 2008 22:22:25 -0600 Subject: [Facebooker-talk] facebooker:tunnel:start In-Reply-To: References: Message-ID: OK, so I finally got the time to work on this, and got rake facebooker:tunnel:start to run, but it's not tunnelling. I'm guessing it has something to do with the file in /etc/ssh/sshd_config ? When I type rake facebooker:tunnel:start, it says: Starting tunnel myserver.com:8001 to 0.0.0.0:3000 But, if I go to myserver.com:8001 it doesn't end up at my server. Anyway, here's how I have my app set up: facebooker.yml: development: api_key: yadayadanumbers secret_key: yadayadanumbersandstuff canvas_page_name: my_app_name callback_url: http://myserver.com:8001 tunnel: public_host_username: my_username public_host: myserver.com public_port: 8001 local_port: 3000 On my server, the only thing I've done to "open" the ports is added this line to etc/ssh/sshd_config : GatewayPorts clientspecified In the application configuration on facebook.com, I have set the callback_url to be: http://myserver.com:8001 Anyway, I feel like I'm getting close, but I don't totally get what the sshd_config file does and I have a feeling I'm missing something. Thanks for all your help. Dustin From david.g.clements at gmail.com Sat Feb 16 17:58:34 2008 From: david.g.clements at gmail.com (David Clements) Date: Sat, 16 Feb 2008 15:58:34 -0700 Subject: [Facebooker-talk] Execute on creation of FB session In-Reply-To: <20080215115454796297.e57fc624@gmail.com> References: <20080215115454796297.e57fc624@gmail.com> Message-ID: <427BAC5F-FE75-47B1-9143-DD7A94A509D2@gmail.com> Hey shawn, I don't have the code in front of me so this might be wrong. Facebooker creates a new facebooker::session object on each request. So I don't think you will be able to hook into the create to do this. I typically have a facebook_users table that I use to cache info about users. That being said I think it is against the TOS to store much more than UID, session key and expires. Dave Sent from my iPhone On Feb 15, 2008, at 12:54 PM, Shawn Van Ittersum wrote: > Is there a way to specify a method to be invoked when an FB session > is created? I'd like to cache certain user/friend info when the > user starts a new session with the app, and then not call the > caching function again on existing sessions. > > Shawn > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From lists at humanesoftware.com Sun Feb 17 16:22:59 2008 From: lists at humanesoftware.com (Mark Slater) Date: Sun, 17 Feb 2008 13:22:59 -0800 Subject: [Facebooker-talk] Patch submission? Message-ID: I've got two additions I'd like to submit for inclusion in facebooker. The first is support for reading Friend Lists (which are, sadly, an underused feature of Facebook); its not a complicated addition, and I wasn't able to find any unit tests that check the facebook rest API requests or responses. I think this one is pretty straightforward, with a low potential for breaking things. The second change I'm less sure of. I found that doing an AJAX call to my application from facebook had some problems with authentication... both in rails and then in facebooker. I was able to solve the Rails form authentication issues by simply providing a secret key in the application controller (since the normal cookie approach doesn't work when you're getting some calls from a facebook server and other calls from the real client). However the facebooker filters (ensuring the user has added the app and is authenticated) failed to work because the AJAX call wasn't requesting a canvas. So I've added a method to the facebooker controller.rb called "request_is_ajax?" and updated the "secure_with_facebook_params!" method to create the :facebook_session if the request is either for a facebook canvas or is an ajax request. It works in my code, but if there's a more correct way that's already there (but I didn't find) to handle Ajax requests made directly to the app via a facebook canvas, then please let me know. So what's the best way to submit these patches? Any requirements or hoops I need to jump through to get them accepted? Mark From shanev at gmail.com Mon Feb 18 02:52:39 2008 From: shanev at gmail.com (Shane Vitarana) Date: Mon, 18 Feb 2008 01:52:39 -0600 Subject: [Facebooker-talk] Patch submission? In-Reply-To: References: Message-ID: <4ab757a40802172352p346f5cc4ya0c9fe344afb6b33@mail.gmail.com> Hey Mark- > So what's the best way to submit these patches? Any requirements or > hoops I need to jump through to get them accepted? Make sure the patch includes tests, and submit it to Rubyforge: http://rubyforge.org/projects/facebooker/. I'm not sure what you mean when you say you couldn't find tests that check the API requests/responses. There are a bunch of them. Check out something like facebook_admin_test. Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From lists at humanesoftware.com Mon Feb 18 04:20:02 2008 From: lists at humanesoftware.com (Mark Slater) Date: Mon, 18 Feb 2008 01:20:02 -0800 Subject: [Facebooker-talk] Patch submission? In-Reply-To: <4ab757a40802172352p346f5cc4ya0c9fe344afb6b33@mail.gmail.com> References: <4ab757a40802172352p346f5cc4ya0c9fe344afb6b33@mail.gmail.com> Message-ID: <5AB47424-1177-49D6-9336-1DF5A9902F31@humanesoftware.com> Well, I didn't find facebook_admin_test, but i did look at facebooker_test.rb and that seems to have the unit tests I'd missed before. I was expecting them to be split among more files, with at least some of them named like the facebooker "model" classes. I guess I didn't know what I should be looking for when I was poking through them that first day. I've never submitted a patch to anything before... what's the process for generating them? I'm on a Unix (mac) system. Mark On Feb 17, 2008, at 11:52 PM, Shane Vitarana wrote: > Hey Mark- > >> So what's the best way to submit these patches? Any requirements or >> hoops I need to jump through to get them accepted? > > Make sure the patch includes tests, and submit it to Rubyforge: > http://rubyforge.org/projects/facebooker/. I'm not sure what you mean > when you say you couldn't find tests that check the API > requests/responses. There are a bunch of them. Check out something > like facebook_admin_test. > > Shane > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From lists at humanesoftware.com Mon Feb 18 04:24:01 2008 From: lists at humanesoftware.com (Mark Slater) Date: Mon, 18 Feb 2008 01:24:01 -0800 Subject: [Facebooker-talk] Updates to static content Message-ID: As I've been writing my app, I've been embedding javascript methods in the FBML that's dynamically generated. As I've got the methods locked down, I moved a bunch to an external static javascript file in public/ javascripts. Now I've got some more methods that are solid enough to move to the static file, but facebook seems to have cached it and I can't get it to update the file. I've tried calling "session[ :facebook_session ].server_cache.refresh_ref_url(...);" in my controller with both the full URL and relative URL for the javascript file, and I get back TRUE. But its been several hours now and facebook still has the old version cached. Is there something else I need to do that will force the update? Thanks! Mark From lists at humanesoftware.com Mon Feb 18 05:49:00 2008 From: lists at humanesoftware.com (Mark Slater) Date: Mon, 18 Feb 2008 02:49:00 -0800 Subject: [Facebooker-talk] Updates to static content In-Reply-To: References: Message-ID: Nevermind .... I found the page that talks about how included javascript and CSS files are cached: http://wiki.developers.facebook.com/index.php/Include_files Mark On Feb 18, 2008, at 1:24 AM, Mark Slater wrote: > As I've been writing my app, I've been embedding javascript methods in > the FBML that's dynamically generated. As I've got the methods locked > down, I moved a bunch to an external static javascript file in public/ > javascripts. Now I've got some more methods that are solid enough to > move to the static file, but facebook seems to have cached it and I > can't get it to update the file. > > I've tried calling > "session[ :facebook_session ].server_cache.refresh_ref_url(...);" in > my controller with both the full URL and relative URL for the > javascript file, and I get back TRUE. But its been several hours now > and facebook still has the old version cached. Is there something else > I need to do that will force the update? > > Thanks! > > Mark > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From shanev at gmail.com Mon Feb 18 11:57:46 2008 From: shanev at gmail.com (Shane Vitarana) Date: Mon, 18 Feb 2008 10:57:46 -0600 Subject: [Facebooker-talk] Patch submission? In-Reply-To: <5AB47424-1177-49D6-9336-1DF5A9902F31@humanesoftware.com> References: <4ab757a40802172352p346f5cc4ya0c9fe344afb6b33@mail.gmail.com> <5AB47424-1177-49D6-9336-1DF5A9902F31@humanesoftware.com> Message-ID: <4ab757a40802180857k82637c0l6cb95e918e90c6f0@mail.gmail.com> Mark- This article explains how to submit patches to open source projects: Good luck! Shane On Feb 18, 2008 3:20 AM, Mark Slater wrote: > Well, I didn't find facebook_admin_test, but i did look at > facebooker_test.rb and that seems to have the unit tests I'd missed > before. I was expecting them to be split among more files, with at > least some of them named like the facebooker "model" classes. I guess > I didn't know what I should be looking for when I was poking through > them that first day. > > I've never submitted a patch to anything before... what's the process > for generating them? I'm on a Unix (mac) system. > > Mark > > > On Feb 17, 2008, at 11:52 PM, Shane Vitarana wrote: > > > Hey Mark- > > > >> So what's the best way to submit these patches? Any requirements or > >> hoops I need to jump through to get them accepted? > > > > Make sure the patch includes tests, and submit it to Rubyforge: > > http://rubyforge.org/projects/facebooker/. I'm not sure what you mean > > when you say you couldn't find tests that check the API > > requests/responses. There are a bunch of them. Check out something > > like facebook_admin_test. > > > > Shane > > > > -- > > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > > > _______________________________________________ > 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 From digidigo at gmail.com Tue Feb 19 19:17:53 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 19 Feb 2008 17:17:53 -0700 Subject: [Facebooker-talk] Added Publisher API to the Tutorial Message-ID: Hey All, Just a quick note , I am loving the new Publisher API in facebooker and added it to the tutorial app. http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed I also added some code to monkey_patch the request response to that you can see it in the log. Any feedback is greatly appreciated, especially if you have some ideas on lessons I should add. Dave From mmangino at elevatedrails.com Wed Feb 20 10:27:30 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Wed, 20 Feb 2008 09:27:30 -0600 Subject: [Facebooker-talk] Added Publisher API to the Tutorial In-Reply-To: References: Message-ID: I just updated the code to include a Rails generator. You can now run scipt/generate publisher Attack to create an attacks_publisher.rb I'll be working on adding profile updates and better template support as the week progresses. Has anyone else used this? If so, I'd love some feedback. Mike On Feb 19, 2008, at 6:17 PM, David Clements wrote: > Hey All, > > Just a quick note , I am loving the new Publisher API in facebooker > and added it to the tutorial app. > > http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed > > I also added some code to monkey_patch the request response to that > you can see it in the log. > > Any feedback is greatly appreciated, especially if you have some ideas > on lessons I should add. > > Dave > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From michael.tedesco at peermeta.com Wed Feb 20 18:38:28 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Wed, 20 Feb 2008 18:38:28 -0500 Subject: [Facebooker-talk] Hi I am having a problem sending email through facebook with an app I created there Message-ID: Here are the steps I did so far but can't seem to get messages posted to the user's of facebook. Any ideas? If the email messaging is working correctly does the emails stay in the user's facebook email notifications or do they get sent back out to their corresponding email accounts (i.e yahoo)? 1) Created an app in facebook and its definitely doing a call back to my app 2) Shared the app with a friend Please see below output and method call. Any ideas Thanks, Mike Tedesco Output : in index friends 2 Anthony Johnson Laurey Tedesco ids 706585 1110434684 email sent for the users 706585 1110434684 should be sent 127.0.0.1 - - [20/Feb/2008:18:33:16 Eastern Standard Time] "GET /facebooker?auth_token=b5a90e821149fbb08a0f4a6b1279bf25 HTTP/1.1" 200 104 http://www.facebook.com/login.php?api_key=3261d0c86fae5b333c2bfa872253887f&v=1.0 -> /facebooker?auth_token=b5a90e821149fbb08a0f4a6b1279bf25 ----------------------------------------------- Code to produce it require 'facebooker' class FacebookerController < ApplicationController ensure_authenticated_to_facebook def index puts "in index" @user = session[:facebook_session].user friends = @user.friends @id_array = Array.new puts "friends " puts friends.size friends.each do |fb_id| an_id = fb_id @id_array.push(an_id) end for a_friend in friends puts a_friend.name end puts "ids" puts @id_array user_ids = [706585, 1110434684] session[:facebook_session].send_email(user_ids, "Nice picture of you sucking down a beer", "hi", "I hope it was a Sam Adams") puts "email sent for the users #{706585} #{""} #{1110434684} should be sent" end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080220/80fbec6c/attachment.html From wil at 3cglabs.com Wed Feb 20 19:02:53 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Wed, 20 Feb 2008 18:02:53 -0600 Subject: [Facebooker-talk] facebooker requires 'json' Message-ID: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> I recently tried upgrading to the newer version of facebooker plugin from r174. I wasn't able to boot up the app server, as it was complaining about options and requires. => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Debugger enabled => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... Exiting /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: warning: already initialized constant OPTIONS /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: undefined method `options' for []:Array (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require' from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require' from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require' from /home/myapp/vendor/rails/railties/lib/commands/server.rb:39 from ./script/server:3:in `require' from ./script/server:3 After tearing my hair out for a bit >:( , the culprit is the first line in lib/facebooker.rb: require 'json' And looking on the ApplicationsPropertyCalls thread on the mailinglist archives, it seems like it's a gem that just got added. Can it be included in the plugin so that newcomers and those of us that upgraded don't have to be perplexed when the app server won't start up? Or at least, have it be mentioned in the README? I'll gladly do the latter, if the former is not an option. Thanks. Wilhelm From shanev at gmail.com Wed Feb 20 19:28:13 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 20 Feb 2008 18:28:13 -0600 Subject: [Facebooker-talk] Hi I am having a problem sending email through facebook with an app I created there In-Reply-To: References: Message-ID: <4ab757a40802201628y6289d3fbhc39c1216ec184686@mail.gmail.com> Michael- It gets sent to their corresponding email accounts. On Wed, Feb 20, 2008 at 5:38 PM, Michael Tedesco wrote: > > > > > Here are the steps I did so far but can't seem to get messages posted to the > user's of facebook. Any ideas? > > If the email messaging is working correctly does the emails stay in the > user's facebook email notifications or do they get sent back out to their > corresponding email accounts (i.e yahoo)? > > > > 1) Created an app in facebook and its definitely doing a call back to > my app > > 2) Shared the app with a friend > > > > Please see below output and method call. Any ideas > > Thanks, Mike Tedesco > > > > Output : > > in index > > friends > > 2 > > Anthony Johnson > > Laurey Tedesco > > ids > > 706585 > > 1110434684 > > email sent for the users 706585 1110434684 should be sent > > 127.0.0.1 - - [20/Feb/2008:18:33:16 Eastern Standard Time] "GET > /facebooker?auth_token=b5a90e821149fbb08a0f4a6b1279bf25 HTTP/1.1" 200 104 > > http://www.facebook.com/login.php?api_key=3261d0c86fae5b333c2bfa872253887f&v=1.0 > -> /facebooker?auth_token=b5a90e821149fbb08a0f4a6b1279bf25 > > > > ----------------------------------------------- > > > > Code to produce it > > require 'facebooker' > > class FacebookerController < ApplicationController > > ensure_authenticated_to_facebook > > > > def index > > puts "in index" > > > > @user = session[:facebook_session].user > > friends = @user.friends > > @id_array = Array.new > > > > puts "friends " > > puts friends.size > > > > friends.each do |fb_id| > > an_id = fb_id > > @id_array.push(an_id) > > end > > > > for a_friend in friends > > puts a_friend.name > > end > > > > puts "ids" > > puts @id_array > > > > user_ids = [706585, 1110434684] > > > > session[:facebook_session].send_email(user_ids, "Nice picture of you > sucking down a beer", "hi", "I hope it was a Sam Adams") > > puts "email sent for the users #{706585} #{""} #{1110434684} should be > sent" > > > > end > > > _______________________________________________ > 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 From sbwoodside at yahoo.com Thu Feb 21 00:55:01 2008 From: sbwoodside at yahoo.com (S. Woodside) Date: Thu, 21 Feb 2008 00:55:01 -0500 Subject: [Facebooker-talk] using mobile features Message-ID: <47E20E6D-99AC-4AF3-9310-08A8834F4F63@yahoo.com> I want to send SMS using the Facebook mobile features: http://wiki.developers.facebook.com/index.php/Mobile I can't find anything about this in the facebooker docs. I'm suspicious that facebook has implemented these features in a slightly bizarro way. Is there any way for me to do calls like sms.send or whatever through facebooker? Even if at first I have to do it a bit hackishly? Thanks, --simon -- http://simonwoodside.com From mmangino at elevatedrails.com Thu Feb 21 09:02:55 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 21 Feb 2008 08:02:55 -0600 Subject: [Facebooker-talk] using mobile features In-Reply-To: <47E20E6D-99AC-4AF3-9310-08A8834F4F63@yahoo.com> References: <47E20E6D-99AC-4AF3-9310-08A8834F4F63@yahoo.com> Message-ID: That sounds pretty typical. They provide an aggregator like interface to receive messages and a simple interface to send them. I would love to see this in Facebooker, but it's not the top thing on my priority list. I still need to finish up the code to make link_to_remote and periodically_call_remote work on Facebook and then to finish up the publisher API. I can definitely give advice on implementing this. It shouldn't be that hard. Mike On Feb 20, 2008, at 11:55 PM, S. Woodside wrote: > I want to send SMS using the Facebook mobile features: > http://wiki.developers.facebook.com/index.php/Mobile > > I can't find anything about this in the facebooker docs. I'm > suspicious that facebook has implemented these features in a slightly > bizarro way. Is there any way for me to do calls like sms.send or > whatever through facebooker? Even if at first I have to do it a bit > hackishly? > > Thanks, > > --simon > > -- > http://simonwoodside.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From michael.tedesco at peermeta.com Thu Feb 21 11:03:21 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Thu, 21 Feb 2008 11:03:21 -0500 Subject: [Facebooker-talk] Any suggestions appreciated and thanks Shane Message-ID: Also Shane I see 200 and 104 Codes. Do you know if these are return codes? Am I making the right call? I check the API and see the following http://wiki.developers.facebook.com/index.php/Notifications.sendEmail See after line below - email sent for the users 706585 1110434684 1118298029 1110434684 should be sent Any ideas from anyone? n Thanks, Mike -----Original Message----- From: Michael Tedesco Sent: Thursday, February 21, 2008 10:39 AM To: 'Shane Vitarana' Subject: RE: [Facebooker-talk] Hi I am having a problem sending email through facebook with an app I created there Tried the suggestions you mentioned, still no luck, have 4 friends then tried to send them the email, and nothing. Is it the right call? Can it be something on facebook end preventing emails to get sent out or registered within the app? Thanks, Mike Output: in index friends 4 Anthony Johnson Laurey Tedesco Krista Tedesco Krista N Tedesco ids 706585 1110434684 1118178412 1118298029 email sent for the users 706585 1110434684 1118298029 1110434684 should be sent 127.0.0.1 - - [21/Feb/2008:10:24:40 Eastern Standard Time] "GET /facebooker?auth_token=f77728e8cecc4095899d0a333d7974ce HTTP/1.1" 200 104 http://www.facebook.com/login.php?api_key=3261d0c86fae5b333c2bfa872253887f&v=1.0 -> /facebooker?auth_token=f77728e8cecc4095899d0a333d7974ce Code: require 'facebooker' class FacebookerController < ApplicationController ensure_authenticated_to_facebook def index puts "in index" # @user = session[:facebook_session].user @user = facebook_session.user friends = @user.friends @id_array = Array.new puts "friends " puts friends.size friends.each do |fb_id| an_id = fb_id @id_array.push(an_id) end for a_friend in friends puts a_friend.name end puts "ids" puts @id_array user_ids = ["706585", "1110434684", "1118178412", "1118298029"] facebook_session.send_email(user_ids, "An email", "Hi I am the text part of the email", "Hi I am the fbml version of the email") puts "email sent for the users #{706585} #{""} #{1110434684} #{""} #{1118178412} #{} #{1118298029} should be sent" end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080221/c4b0fd06/attachment.html From shanev at gmail.com Thu Feb 21 11:49:34 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 21 Feb 2008 10:49:34 -0600 Subject: [Facebooker-talk] facebooker requires 'json' In-Reply-To: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> References: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> Message-ID: <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> Wilhelm- The json gem is included as a depenency on the facebooker gem. How are you installing it? If you are installing it as a Rails plugin using script/plugin, the gem dependency mechanism probably wont' work. Does anyone know how to add a dependency on a Rails plugin? Has anyone tried this with Piston? Thanks, Shane On Wed, Feb 20, 2008 at 6:02 PM, Wilhelm Chung wrote: > I recently tried upgrading to the newer version of facebooker plugin > from r174. I wasn't able to boot up the app server, as it was > complaining about options and requires. > > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > => Rails application starting on http://0.0.0.0:3000 > => Debugger enabled > => Call with -d to detach > => Ctrl-C to shutdown server > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > Exiting > /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: > warning: already initialized constant OPTIONS > /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: > undefined method `options' for []:Array (NoMethodError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > `gem_original_require' > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > `require' > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in > `require' > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in > `new_constants_in' > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in > `require' > from /home/myapp/vendor/rails/railties/lib/commands/server.rb:39 > from ./script/server:3:in `require' > from ./script/server:3 > > After tearing my hair out for a bit >:( , the culprit is the first > line in lib/facebooker.rb: > > require 'json' > > And looking on the ApplicationsPropertyCalls thread on the mailinglist > archives, it seems like it's a gem that just got added. > > Can it be included in the plugin so that newcomers and those of us > that upgraded don't have to be perplexed when the app server won't > start up? Or at least, have it be mentioned in the README? I'll > gladly do the latter, if the former is not an option. Thanks. > > Wilhelm > _______________________________________________ > 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 From mmangino at elevatedrails.com Thu Feb 21 11:55:45 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 21 Feb 2008 10:55:45 -0600 Subject: [Facebooker-talk] facebooker requires 'json' In-Reply-To: <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> References: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> Message-ID: <5598CC3F-F7D4-40C4-921B-9D6D456DBF2D@elevatedrails.com> Where are we using the json support? Is that something that we could just disable if the gem isn't present? This bit me too because I install with piston. Mike On Feb 21, 2008, at 10:49 AM, Shane Vitarana wrote: > Wilhelm- > > The json gem is included as a depenency on the facebooker gem. How > are you installing it? If you are installing it as a Rails plugin > using script/plugin, the gem dependency mechanism probably wont' work. > Does anyone know how to add a dependency on a Rails plugin? Has > anyone tried this with Piston? > > Thanks, > Shane > > On Wed, Feb 20, 2008 at 6:02 PM, Wilhelm Chung > wrote: >> I recently tried upgrading to the newer version of facebooker plugin >> from r174. I wasn't able to boot up the app server, as it was >> complaining about options and requires. >> >> => Booting Mongrel (use 'script/server webrick' to force WEBrick) >> => Rails application starting on http://0.0.0.0:3000 >> => Debugger enabled >> => Call with -d to detach >> => Ctrl-C to shutdown server >> ** Starting Mongrel listening at 0.0.0.0:3000 >> ** Starting Rails with development environment... >> Exiting >> /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: >> warning: already initialized constant OPTIONS >> /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: >> undefined method `options' for []:Array (NoMethodError) >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: >> 32:in >> `gem_original_require' >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: >> 32:in >> `require' >> from /home/myapp/vendor/rails/activesupport/lib/ >> active_support/dependencies.rb:496:in >> `require' >> from /home/myapp/vendor/rails/activesupport/lib/ >> active_support/dependencies.rb:342:in >> `new_constants_in' >> from /home/myapp/vendor/rails/activesupport/lib/ >> active_support/dependencies.rb:496:in >> `require' >> from /home/myapp/vendor/rails/railties/lib/commands/ >> server.rb:39 >> from ./script/server:3:in `require' >> from ./script/server:3 >> >> After tearing my hair out for a bit >:( , the culprit is the first >> line in lib/facebooker.rb: >> >> require 'json' >> >> And looking on the ApplicationsPropertyCalls thread on the >> mailinglist >> archives, it seems like it's a gem that just got added. >> >> Can it be included in the plugin so that newcomers and those of us >> that upgraded don't have to be perplexed when the app server won't >> start up? Or at least, have it be mentioned in the README? I'll >> gladly do the latter, if the former is not an option. Thanks. >> >> Wilhelm >> _______________________________________________ >> 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 > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From shanev at gmail.com Thu Feb 21 12:01:13 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 21 Feb 2008 11:01:13 -0600 Subject: [Facebooker-talk] Any suggestions appreciated and thanks Shane In-Reply-To: References: Message-ID: <4ab757a40802210901v6d2b5902p8b3422bf3fc8a323@mail.gmail.com> Michael- 104 is the Incorrect Signature error. Make sure the session key that used to make the call is the same as the one in params. Print out both so you can tell if there is a mismatch. On Thu, Feb 21, 2008 at 10:03 AM, Michael Tedesco wrote: > > > > > Also Shane I see 200 and 104 Codes. Do you know if these are return codes? > Am I making the right call? I check the API and see the following > http://wiki.developers.facebook.com/index.php/Notifications.sendEmail > > > > See after line below - email sent for the users 706585 1110434684 > 1118298029 1110434684 should be sent > > Any ideas from anyone? > > n Thanks, Mike > > > > -----Original Message----- > > From: Michael Tedesco > > Sent: Thursday, February 21, 2008 10:39 AM > > To: 'Shane Vitarana' > > Subject: RE: [Facebooker-talk] Hi I am having a problem sending email > through facebook with an app I created there > > > > Tried the suggestions you mentioned, still no luck, have 4 friends then > tried to send them the email, and nothing. Is it the right call? Can it be > something on facebook end preventing emails to get sent out or registered > within the app? > > Thanks, Mike > > > > Output: > > in index > > friends > > 4 > > Anthony Johnson > > Laurey Tedesco > > Krista Tedesco > > Krista N Tedesco > > ids > > 706585 > > 1110434684 > > 1118178412 > > 1118298029 > > email sent for the users 706585 1110434684 1118298029 1110434684 should > be sent > > 127.0.0.1 - - [21/Feb/2008:10:24:40 Eastern Standard Time] "GET > /facebooker?auth_token=f77728e8cecc4095899d0a333d7974ce HTTP/1.1" 200 104 > http://www.facebook.com/login.php?api_key=3261d0c86fae5b333c2bfa872253887f&v=1.0 > -> /facebooker?auth_token=f77728e8cecc4095899d0a333d7974ce > > Code: > > > > require 'facebooker' > > class FacebookerController < ApplicationController > > > > ensure_authenticated_to_facebook > > def index > > puts "in index" > > > > # @user = session[:facebook_session].user > > @user = facebook_session.user > > friends = @user.friends > > @id_array = Array.new > > > > puts "friends " > > puts friends.size > > > > friends.each do |fb_id| > > an_id = fb_id > > @id_array.push(an_id) > > end > > > > for a_friend in friends > > puts a_friend.name > > end > > > > puts "ids" > > puts @id_array > > > > user_ids = ["706585", "1110434684", "1118178412", "1118298029"] > > > > facebook_session.send_email(user_ids, "An email", "Hi I am the text part > of the email", "Hi I am the fbml version of the email") > > puts "email sent for the users #{706585} #{""} #{1110434684} #{""} > #{1118178412} #{} #{1118298029} should be sent" > > > > end > > > _______________________________________________ > 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 From shanev at gmail.com Thu Feb 21 12:11:09 2008 From: shanev at gmail.com (Shane Vitarana) Date: Thu, 21 Feb 2008 11:11:09 -0600 Subject: [Facebooker-talk] facebooker requires 'json' In-Reply-To: <5598CC3F-F7D4-40C4-921B-9D6D456DBF2D@elevatedrails.com> References: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> <5598CC3F-F7D4-40C4-921B-9D6D456DBF2D@elevatedrails.com> Message-ID: <4ab757a40802210911l70bf5debx296d822b34166c0e@mail.gmail.com> Mike- It is used for the get_app_properties call, which retrieves all the properties as a json array that needs to be parsed. If the json gem is disabled, that call won't work. This dependency should work fine for gem installations, but I'm sure there is a dependency mechanism for plugins that we can incorporate. Does Piston not install dependencies? I'm sure this problem has been solved elsewhere. Shane On Thu, Feb 21, 2008 at 10:55 AM, Mike Mangino wrote: > Where are we using the json support? Is that something that we could > just disable if the gem isn't present? This bit me too because I > install with piston. > > Mike > > > > On Feb 21, 2008, at 10:49 AM, Shane Vitarana wrote: > > > Wilhelm- > > > > The json gem is included as a depenency on the facebooker gem. How > > are you installing it? If you are installing it as a Rails plugin > > using script/plugin, the gem dependency mechanism probably wont' work. > > Does anyone know how to add a dependency on a Rails plugin? Has > > anyone tried this with Piston? > > > > Thanks, > > Shane > > > > On Wed, Feb 20, 2008 at 6:02 PM, Wilhelm Chung > > wrote: > >> I recently tried upgrading to the newer version of facebooker plugin > >> from r174. I wasn't able to boot up the app server, as it was > >> complaining about options and requires. > >> > >> => Booting Mongrel (use 'script/server webrick' to force WEBrick) > >> => Rails application starting on http://0.0.0.0:3000 > >> => Debugger enabled > >> => Call with -d to detach > >> => Ctrl-C to shutdown server > >> ** Starting Mongrel listening at 0.0.0.0:3000 > >> ** Starting Rails with development environment... > >> Exiting > >> /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: > >> warning: already initialized constant OPTIONS > >> /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: > >> undefined method `options' for []:Array (NoMethodError) > >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: > >> 32:in > >> `gem_original_require' > >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: > >> 32:in > >> `require' > >> from /home/myapp/vendor/rails/activesupport/lib/ > >> active_support/dependencies.rb:496:in > >> `require' > >> from /home/myapp/vendor/rails/activesupport/lib/ > >> active_support/dependencies.rb:342:in > >> `new_constants_in' > >> from /home/myapp/vendor/rails/activesupport/lib/ > >> active_support/dependencies.rb:496:in > >> `require' > >> from /home/myapp/vendor/rails/railties/lib/commands/ > >> server.rb:39 > >> from ./script/server:3:in `require' > >> from ./script/server:3 > >> > >> After tearing my hair out for a bit >:( , the culprit is the first > >> line in lib/facebooker.rb: > >> > >> require 'json' > >> > >> And looking on the ApplicationsPropertyCalls thread on the > >> mailinglist > >> archives, it seems like it's a gem that just got added. > >> > >> Can it be included in the plugin so that newcomers and those of us > >> that upgraded don't have to be perplexed when the app server won't > >> start up? Or at least, have it be mentioned in the README? I'll > >> gladly do the latter, if the former is not an option. Thanks. > >> > >> Wilhelm > >> _______________________________________________ > >> 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 > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com From wil at 3cglabs.com Thu Feb 21 15:32:59 2008 From: wil at 3cglabs.com (Wilhelm Chung) Date: Thu, 21 Feb 2008 14:32:59 -0600 Subject: [Facebooker-talk] facebooker requires 'json' In-Reply-To: <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> References: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> Message-ID: <4cdd0d160802211232o640b973bv4b4bdb702a6c8cf1@mail.gmail.com> Yeah, I installed it using piston. I wasn't aware that piston pulled in dependencies as well (if it does, it doesn't appear to do so). I ended up installing the json gem, and then freezing it to the rails vendor/gems directory. And then I included it in the load_paths in the configuration for environment.rb (I'm on a shared host) Wilhelm On Thu, Feb 21, 2008 at 10:49 AM, Shane Vitarana wrote: > Wilhelm- > > The json gem is included as a depenency on the facebooker gem. How > are you installing it? If you are installing it as a Rails plugin > using script/plugin, the gem dependency mechanism probably wont' work. > Does anyone know how to add a dependency on a Rails plugin? Has > anyone tried this with Piston? > > Thanks, > Shane > > > > On Wed, Feb 20, 2008 at 6:02 PM, Wilhelm Chung wrote: > > I recently tried upgrading to the newer version of facebooker plugin > > from r174. I wasn't able to boot up the app server, as it was > > complaining about options and requires. > > > > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > > => Rails application starting on http://0.0.0.0:3000 > > => Debugger enabled > > => Call with -d to detach > > => Ctrl-C to shutdown server > > ** Starting Mongrel listening at 0.0.0.0:3000 > > ** Starting Rails with development environment... > > Exiting > > /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: > > warning: already initialized constant OPTIONS > > /home/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: > > undefined method `options' for []:Array (NoMethodError) > > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > > `gem_original_require' > > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > > `require' > > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in > > `require' > > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in > > `new_constants_in' > > from /home/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in > > `require' > > from /home/myapp/vendor/rails/railties/lib/commands/server.rb:39 > > from ./script/server:3:in `require' > > from ./script/server:3 > > > > After tearing my hair out for a bit >:( , the culprit is the first > > line in lib/facebooker.rb: > > > > require 'json' > > > > And looking on the ApplicationsPropertyCalls thread on the mailinglist > > archives, it seems like it's a gem that just got added. > > > > Can it be included in the plugin so that newcomers and those of us > > that upgraded don't have to be perplexed when the app server won't > > start up? Or at least, have it be mentioned in the README? I'll > > gladly do the latter, if the former is not an option. Thanks. > > > > Wilhelm > > _______________________________________________ > > 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 > -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com From sbwoodside at yahoo.com Thu Feb 21 18:33:29 2008 From: sbwoodside at yahoo.com (S. Woodside) Date: Thu, 21 Feb 2008 18:33:29 -0500 Subject: [Facebooker-talk] using mobile features In-Reply-To: References: <47E20E6D-99AC-4AF3-9310-08A8834F4F63@yahoo.com> Message-ID: <152C6793-17C4-4B46-BCB5-197E7B944756@yahoo.com> Yeah, I definitely want advice on how to implement it! Especially if I can do it in a couple of days. --simon -- http://simonwoodside.com On Feb 21, 2008, at 9:02 AM, Mike Mangino wrote: > That sounds pretty typical. They provide an aggregator like > interface to receive messages and a simple interface to send them. > I would love to see this in Facebooker, but it's not the top thing > on my priority list. I still need to finish up the code to make > link_to_remote and periodically_call_remote work on Facebook and > then to finish up the publisher API. > > I can definitely give advice on implementing this. It shouldn't be > that hard. > > Mike > > On Feb 20, 2008, at 11:55 PM, S. Woodside wrote: > >> I want to send SMS using the Facebook mobile features: >> http://wiki.developers.facebook.com/index.php/Mobile >> >> I can't find anything about this in the facebooker docs. I'm >> suspicious that facebook has implemented these features in a slightly >> bizarro way. Is there any way for me to do calls like sms.send or >> whatever through facebooker? Even if at first I have to do it a bit >> hackishly? >> >> Thanks, >> >> --simon >> >> -- >> http://simonwoodside.com >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > From mmangino at elevatedrails.com Thu Feb 21 18:45:36 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 21 Feb 2008 17:45:36 -0600 Subject: [Facebooker-talk] facebooker requires 'json' In-Reply-To: <4cdd0d160802211232o640b973bv4b4bdb702a6c8cf1@mail.gmail.com> References: <4cdd0d160802201602y342c0b63l4cf1ee236a68142@mail.gmail.com> <4ab757a40802210849l27e76d36t313ce5dd7b98b7a4@mail.gmail.com> <4cdd0d160802211232o640b973bv4b4bdb702a6c8cf1@mail.gmail.com> Message-ID: It doesn't. There are no dependencies there. I'd rather have the get_app_properties call not work than to have my whole app fail. If we're going to leave this requirement in, we need to remove the line about "requiring only the standard library" from the package description :) On Feb 21, 2008, at 2:32 PM, Wilhelm Chung wrote: > Yeah, I installed it using piston. I wasn't aware that piston pulled > in dependencies as well (if it does, it doesn't appear to do so). > > I ended up installing the json gem, and then freezing it to the rails > vendor/gems directory. And then I included it in the load_paths in > the configuration for environment.rb (I'm on a shared host) > > Wilhelm -- Mike Mangino http://www.elevatedrails.com From mmangino at elevatedrails.com Thu Feb 21 18:48:54 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 21 Feb 2008 17:48:54 -0600 Subject: [Facebooker-talk] Added Publisher API to the Tutorial In-Reply-To: References: Message-ID: <6086B866-F0BB-4D84-AAB6-E9F14DAE297B@elevatedrails.com> And yet another update, no with rendering goodness def AttackPublisher < Facebooker::Rails::Publisher def profile_update(user) send_as :profile recipients user profile render(:partial=>"profile",:assigns=>{:user=>user} end end When I call AttackPublisher.deliver_profile_update(user) it will render app/views/_profile.erb with @user set to user and then send the profile FBML to Facebook You can now render in all of your Publisher methods. Enjoy! Mike On Feb 20, 2008, at 9:27 AM, Mike Mangino wrote: > I just updated the code to include a Rails generator. You can now run > scipt/generate publisher Attack to create an attacks_publisher.rb > > I'll be working on adding profile updates and better template support > as the week progresses. > > Has anyone else used this? If so, I'd love some feedback. > > Mike > > > On Feb 19, 2008, at 6:17 PM, David Clements wrote: > >> Hey All, >> >> Just a quick note , I am loving the new Publisher API in facebooker >> and added it to the tutorial app. >> >> http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed >> >> I also added some code to monkey_patch the request response to that >> you can see it in the log. >> >> Any feedback is greatly appreciated, especially if you have some >> ideas >> on lessons I should add. >> >> Dave >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From mmangino at elevatedrails.com Fri Feb 22 15:16:18 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 22 Feb 2008 14:16:18 -0600 Subject: [Facebooker-talk] Announcing the new Batch API Message-ID: <8233C83D-2C6A-4F9C-8F4A-9A51C808CD6E@elevatedrails.com> It's been a month since the facebook batch API was announced. Now, you can use it with your favorite framework. First, an example: facebook_session.batch do @send_result = facebook_session.send_notification([12451752],"Woohoo") @albums = facebook_session.user.albums end puts @albums.first.inspect Every call to Facebook for the batched session will be sent at once. Results are available outside of the block. In the above example, you can't access @albums inside the block passed to batch (After all, the albums haven't been retrieved yet) Once the block is executed, you can treat @albums just like the old return value. Some internal changes were required for this to work. I updated all of the accesses I saw in session, user and data. Let me know if you get errors anywhere else. I'll be blogging about the implementation at some point. It's a pretty cool example of dynamic ruby. Mike -- Mike Mangino http://www.elevatedrails.com From heavysixer at gmail.com Fri Feb 22 20:08:05 2008 From: heavysixer at gmail.com (Heavy Sixer) Date: Fri, 22 Feb 2008 19:08:05 -0600 Subject: [Facebooker-talk] one line helper Message-ID: I thought i'd share this snippet with others on the list who want to use the facebooker before filters but also want their app to run on a non-facebook format too: before_filter {|controller| ensure_application_is_installed_by_facebook_user if controller.params ["format"] == "fbml" } This simply wraps the facebooker before_filter in a proc and only executes it if the format is "fbml" Hope that is helpful. Mark From heavysixer at gmail.com Fri Feb 22 22:50:21 2008 From: heavysixer at gmail.com (Heavy Sixer) Date: Fri, 22 Feb 2008 21:50:21 -0600 Subject: [Facebooker-talk] Slight error in my before_filter snippet Message-ID: I have an itchy trigger finger and sent the wrong version of my before_filter check. Here is the "actual working" before filter ;-) before_filter { |controller| controller.send (:ensure_authenticated_to_facebook) if controller.params["format"] == "fbml" } From matthieu.ruiz at gmail.com Sun Feb 24 07:23:22 2008 From: matthieu.ruiz at gmail.com (Matthieu Ruiz) Date: Sun, 24 Feb 2008 13:23:22 +0100 Subject: [Facebooker-talk] Call a javascript function from a controller Message-ID: Hi, I don't really understand if it's possible to call a javascript function from a rails controller. For instance, I want to update my view when someone submit my form and after I checked it was valid. ( puts a "" in my case). def save # I do all my verifications... render :update do |page| page.call "my_javascript_function" # Or with facebook id : page.call "aXXXXXXXX_my_javascript_function" end end Is there a way to do it ? Thanks a lot, I'm a bit lost :S Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080224/5af4e493/attachment.html From heavysixer at gmail.com Sun Feb 24 09:13:13 2008 From: heavysixer at gmail.com (Heavy Sixer) Date: Sun, 24 Feb 2008 08:13:13 -0600 Subject: [Facebooker-talk] Call a javascript function from a controller In-Reply-To: References: Message-ID: <0263BD80-E667-4F81-890B-4D9BB8C476F8@gmail.com> Matt, You need to read up on respond_to blocks it takes a .js argument to be used when a page requests a javascript return object. You can then use something like an rjs template to update the page that called it through something like an ajax event. Mark On Feb 24, 2008, at 6:23 AM, Matthieu Ruiz wrote: > Hi, > > I don't really understand if it's possible to call a javascript > function from a rails controller. > For instance, I want to update my view when someone submit my form > and after I checked it was valid. ( puts a " \"Changes saved.\" />" in my case). > > def save > # I do all my verifications... > render :update do |page| > page.call "my_javascript_function" > # Or with facebook id : page.call > "aXXXXXXXX_my_javascript_function" > end > end > > Is there a way to do it ? > Thanks a lot, I'm a bit lost :S > > Matt > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From jnylund at yahoo.com Sun Feb 24 10:43:51 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Sun, 24 Feb 2008 10:43:51 -0500 Subject: [Facebooker-talk] Call a javascript function from a controller In-Reply-To: References: Message-ID: I could be wrong, but I dont think the rjs stuff works out of the box with facebook. Mike is working on a facebook specific link_to_remote that will be the simplest way to do this , but until then you can do it yourself. see http://jnylund.typepad.com/joels_blog/2008/02/ajax-rails-face.html for some examples of how to do ajax/js stuff in facebook. Joel On Feb 24, 2008, at 7:23 AM, Matthieu Ruiz wrote: > Hi, > > I don't really understand if it's possible to call a javascript > function from a rails controller. > For instance, I want to update my view when someone submit my form > and after I checked it was valid. ( puts a " \"Changes saved.\" />" in my case). > > def save > # I do all my verifications... > render :update do |page| > page.call "my_javascript_function" > # Or with facebook id : page.call > "aXXXXXXXX_my_javascript_function" > end > end > > Is there a way to do it ? > Thanks a lot, I'm a bit lost :S > > Matt > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From digidigo at gmail.com Sun Feb 24 11:21:53 2008 From: digidigo at gmail.com (David Clements) Date: Sun, 24 Feb 2008 09:21:53 -0700 Subject: [Facebooker-talk] Call a javascript function from a controller In-Reply-To: References: Message-ID: If you look at Joel's second example and wrap you javascript function call in " else txt_to_render = "" end render :text => txt_to_render, :layout => false end Dave On Sun, Feb 24, 2008 at 8:43 AM, Joel Nylund wrote: > I could be wrong, but I dont think the rjs stuff works out of the box > with facebook. Mike is working on a facebook specific link_to_remote > that will be the simplest way to do this , but until then you can do > it yourself. > > see http://jnylund.typepad.com/joels_blog/2008/02/ajax-rails-face.html > for some examples of how to do ajax/js stuff in facebook. > > Joel > > > > > On Feb 24, 2008, at 7:23 AM, Matthieu Ruiz wrote: > > > > > Hi, > > > > I don't really understand if it's possible to call a javascript > > function from a rails controller. > > For instance, I want to update my view when someone submit my form > > and after I checked it was valid. ( puts a " > \"Changes saved.\" />" in my case). > > > > def save > > # I do all my verifications... > > render :update do |page| > > page.call "my_javascript_function" > > # Or with facebook id : page.call > > "aXXXXXXXX_my_javascript_function" > > end > > end > > > > Is there a way to do it ? > > Thanks a lot, I'm a bit lost :S > > > > Matt > > > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From lists at humanesoftware.com Sun Feb 24 20:09:05 2008 From: lists at humanesoftware.com (Mark Slater) Date: Sun, 24 Feb 2008 17:09:05 -0800 Subject: [Facebooker-talk] Running Facebooker from script/runner Message-ID: <27A1059D-D1A9-4523-80CB-0C73789B704F@humanesoftware.com> I'm setting up a recurring (cron) task to trigger a method in my facebook controller. The point is to find all users that need to receive notification emails and send those messages off (every few hours, and only if they haven't been sent already... don't want to be spammy). I've got infinite session keys for the users (at least for the ones who will be receiving email notifications), but I don't know how to create a Facebooker session from those. I tried calling set_facebooker_session, but got this error: undefined local variable or method `set_facebook_session' for FacebookController:Class So it seems that the script/runner isn't loading the facebooker plugin? Which doesn't make much sense, because the facebooker YML config file is being processed, and that wouldn't happen if the plugin didn't get loaded. What am I missing here? Is there a better way to do recurring background notification tasks with facebooker? Thanks! Mark From lists at humanesoftware.com Mon Feb 25 05:21:21 2008 From: lists at humanesoftware.com (Mark Slater) Date: Mon, 25 Feb 2008 02:21:21 -0800 Subject: [Facebooker-talk] Running Facebooker from script/runner In-Reply-To: <27A1059D-D1A9-4523-80CB-0C73789B704F@humanesoftware.com> References: <27A1059D-D1A9-4523-80CB-0C73789B704F@humanesoftware.com> Message-ID: <2981F512-7F8D-420A-B997-2D212F32166A@humanesoftware.com> I was able to solve this problem using some code I found in the facebooker_mq plugin - http://rubyforge.org/projects/facebooker-mq/ First, I create a session object, which is re-used for each user that needs a message sent: session = Facebooker::CanvasSession.create( ENV[ 'FACEBOOK_API_KEY' ], ENV[ 'FACEBOOK_SECRET_KEY' ] ) Then, for each user being notified, if I've stored an infinite session key for them, I secure the session (I only store the session keys if they're infinite, so the expires parameter at the end is always 0): session.secure_with!( currentUser.infinite_session, currentUser.id, 0 ) Once that is done, the session key can be used normally (at least for the one call I'm making send_email). The other thing I did, just to make sure this doesn't mess up "normal" operation, was to move the background tasks into their own controller. I did not have this new class extend the ApplicationController class, because it doesn't render any pages and so isn't a true Rails controller. I'm not totally sure, but I think its possible this code could be run out of a class in the lib directory (or a model class, if that were more appropriate for someone else's app). If there's a better way to solve this problem, I'd be interested in knowing about it. Thanks! Mark On Feb 24, 2008, at 5:09 PM, Mark Slater wrote: > I'm setting up a recurring (cron) task to trigger a method in my > facebook controller. The point is to find all users that need to > receive notification emails and send those messages off (every few > hours, and only if they haven't been sent already... don't want to be > spammy). > > I've got infinite session keys for the users (at least for the ones > who will be receiving email notifications), but I don't know how to > create a Facebooker session from those. I tried calling > set_facebooker_session, but got this error: > > undefined local variable or method `set_facebook_session' for > FacebookController:Class > > So it seems that the script/runner isn't loading the facebooker > plugin? Which doesn't make much sense, because the facebooker YML > config file is being processed, and that wouldn't happen if the plugin > didn't get loaded. What am I missing here? Is there a better way to do > recurring background notification tasks with facebooker? > > Thanks! > > Mark > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From ahmad at 360in.com Mon Feb 25 06:59:52 2008 From: ahmad at 360in.com (Ahmad AbdulLateef) Date: Mon, 25 Feb 2008 17:29:52 +0530 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> Message-ID: <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> Hi guys, I'm just getting started with facebooker. I got a nasty problem. Every request redirects to facebook for authentication because i have included ensure_authenticated_to_facebook and oce the authentication is over I'm redirected back to the callback URL. The original requested URL is lost. I suspected of not using DB sessions, but I'm using DB as the session store. Please help me out. How do I avoid redirects -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080225/2adba52f/attachment.html From digidigo at gmail.com Mon Feb 25 09:40:17 2008 From: digidigo at gmail.com (David Clements) Date: Mon, 25 Feb 2008 07:40:17 -0700 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> Message-ID: Hey Ahmad, There is an example of this on the facebooker_tutorial , starts at step 4. http://apps.facebook.com/facebooker_tutorial/getting_started/user_adds_application Basically you can store the last_requested_url in a cookie, and then have facebook call an action that does the redirect for you. This is called the POST_ADD_URL on the application settings. Let me know if it makes sense, if not I will bust it out into its own lesson on the tutorial. Dave On Mon, Feb 25, 2008 at 4:59 AM, Ahmad AbdulLateef wrote: > > Hi guys, > > I'm just getting started with facebooker. I got a nasty problem. Every > request redirects to facebook for authentication because i have included > > ensure_authenticated_to_facebook and oce the authentication is over I'm > redirected back to the callback URL. The original requested URL is lost. I > suspected of not using DB sessions, but I'm using DB as the session store. > > > > Please help me out. How do I avoid redirects > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > From sudara at alonetone.com Mon Feb 25 16:40:11 2008 From: sudara at alonetone.com (sudara) Date: Mon, 25 Feb 2008 11:40:11 -1000 Subject: [Facebooker-talk] as promised, the facebooker tutorial Message-ID: <71C41C4A-666D-45C7-9529-34ACB102AF83@alonetone.com> I found this laying around on my computer from January and published it. Hopefully it can help, though I'm sure some of it is out of date. I'm still revising it, feel free to comment. http://joots.com/2008/2/25/actually-going-somewhere-with-facebook-and-the-rails-facebooker-plugin From ahmad at 360in.com Tue Feb 26 08:04:06 2008 From: ahmad at 360in.com (Ahmad AbdulLateef) Date: Tue, 26 Feb 2008 18:34:06 +0530 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> Message-ID: <99a6c1ee0802260504me3c7979j83a565701fd9957f@mail.gmail.com> Hi Dave, I'm not quite able to get it! I would be really great if you could show a sample app and I encouter a new problem. On my local machine everything works great but when i took it to my server at dreamhost, my app breaks with an error like Filter Chain Halted at ensure_authenticated_to_facebook. Now I get this dumb error like Facebooker::Session::IncorrectSignature when i included ensure_application_is_installed_by_facebook_user Any idea on this one? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080226/3b0e4db2/attachment.html From mniessner at elevatedrails.com Tue Feb 26 10:50:29 2008 From: mniessner at elevatedrails.com (Michael Niessner) Date: Tue, 26 Feb 2008 09:50:29 -0600 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> Message-ID: <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> You could add the following to you application controller. def application_is_not_installed_by_facebook_user redirect_to session[:facebook_session].install_url(:next => request.request_uri) end This tells facebooker you want to redirect to the install url and set the next param to the original request when the application is not installed. After the user completes the install page facebook will redirect to the next param. Michael Niessner On Feb 25, 2008, at 5:59 AM, Ahmad AbdulLateef wrote: > Hi guys, > > I'm just getting started with facebooker. I got a nasty problem. > Every request redirects to facebook for authentication because i > have included > ensure_authenticated_to_facebook and oce the authentication is over > I'm redirected back to the callback URL. The original requested URL > is lost. I suspected of not using DB sessions, but I'm using DB as > the session store. > > > Please help me out. How do I avoid redirects > > _______________________________________________ > 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/20080226/92100ef7/attachment.html From digidigo at gmail.com Tue Feb 26 16:42:37 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 26 Feb 2008 14:42:37 -0700 Subject: [Facebooker-talk] Bebo anyone? Message-ID: I am spending a couple of days looking at getting facebooker to work with Bebo. Anyone else working on this? Dave From ahmad at 360in.com Wed Feb 27 04:16:14 2008 From: ahmad at 360in.com (Ahmad AbdulLateef) Date: Wed, 27 Feb 2008 14:46:14 +0530 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> Message-ID: <99a6c1ee0802270116q7fff57eerc1a5a06037174664@mail.gmail.com> Well tats not my problem. Its like when I include ensure_application_is_installed_by_facebook_user at times I get this error Facebooker::Session::IncorrectSignature and other times I get redirected to the Install page which says You've already added AhmadTestApp to your Facebook applications. Visit the My Applications page to adjust your settings or remove this app. I have unfrtunately a bad time with facebooer :-( . Can anyone please zip a basic working hello world facebooker app which includes ensure_application_is_installed_by_facebook_user. So tat I can look at where I messed up or find out if its gotta do with my system perse. Any help would be largely appreciated. On Tue, Feb 26, 2008 at 9:20 PM, Michael Niessner < mniessner at elevatedrails.com> wrote: > You could add the following to you application controller. > def application_is_not_installed_by_facebook_user > redirect_to session[:facebook_session].install_url(:next => > request.request_uri) > end > > This tells facebooker you want to redirect to the install url and set the > next param to the original request when the application is not installed. > After the user completes the install page facebook will redirect to the next > param. > > Michael Niessner > > On Feb 25, 2008, at 5:59 AM, Ahmad AbdulLateef wrote: > > Hi guys, > > I'm just getting started with facebooker. I got a nasty problem. Every > request redirects to facebook for authentication because i have included > > ensure_authenticated_to_facebook and oce the authentication is over I'm > redirected back to the callback URL. The original requested URL is lost. I > suspected of not using DB sessions, but I'm using DB as the session store. > > > Please help me out. How do I avoid redirects > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > -- Regards Ahmad Software Architect Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | Skype:ahmadifx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080227/e9fda4cf/attachment.html From jnylund at yahoo.com Wed Feb 27 09:45:31 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Wed, 27 Feb 2008 09:45:31 -0500 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802270116q7fff57eerc1a5a06037174664@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> <99a6c1ee0802270116q7fff57eerc1a5a06037174664@mail.gmail.com> Message-ID: <9484DB2F-032E-4834-B6C8-D56A4AD199E3@yahoo.com> Hi Ahmad, Im guessing you have something wrong with your configuration either on facebook or in your facebooker.yml file. make sure your facebook configs of Canvas Page URL("AhmadTestApp") match the canvas_page_name in facebooker.yml (in correct section) make sure your setup to fbml & website How are you accessing your application (what url?) - for facebooker setup with canvas & fbml you need to be going via http://apps.facebook.com/yourapp which version of facebooker do you have? which version rails do you have? I put directions to get a basic working version of facebooker going here: (they are 1.2.x rails directions, but they should work in 2.x) http://jnylund.typepad.com/joels_blog/2008/01/facebooker-gett.html Also Davids tutorial should help as well. Joel On Feb 27, 2008, at 4:16 AM, Ahmad AbdulLateef wrote: > Well tats not my problem. Its like when I include > ensure_application_is_installed_by_facebook_user at times I get this > error Facebooker::Session::IncorrectSignature and other times I get > redirected to the Install page which says > > You've already added AhmadTestApp to your Facebook applications. > Visit the My Applications page to adjust your settings or remove > this app. > I have unfrtunately a bad time with facebooer :-( . Can anyone > please zip a basic working hello world facebooker app which includes > ensure_application_is_installed_by_facebook_user. So tat I can look > at where I messed up or find out if its gotta do with my system perse. > > Any help would be largely appreciated. > > On Tue, Feb 26, 2008 at 9:20 PM, Michael Niessner > wrote: > You could add the following to you application controller. > > def application_is_not_installed_by_facebook_user > redirect_to session[:facebook_session].install_url(:next => > request.request_uri) > end > > This tells facebooker you want to redirect to the install url and > set the next param to the original request when the application is > not installed. After the user completes the install page facebook > will redirect to the next param. > > Michael Niessner > > On Feb 25, 2008, at 5:59 AM, Ahmad AbdulLateef wrote: > >> Hi guys, >> >> I'm just getting started with facebooker. I got a nasty problem. >> Every request redirects to facebook for authentication because i >> have included >> ensure_authenticated_to_facebook and oce the authentication is over >> I'm redirected back to the callback URL. The original requested URL >> is lost. I suspected of not using DB sessions, but I'm using DB as >> the session store. >> >> >> Please help me out. How do I avoid redirects >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > -- > Regards > Ahmad > Software Architect > Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | > Skype:ahmadifx _______________________________________________ > 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/20080227/ff1d2ae4/attachment.html From michael.tedesco at peermeta.com Wed Feb 27 13:05:44 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Wed, 27 Feb 2008 13:05:44 -0500 Subject: [Facebooker-talk] Anyway to obtain some of your friend's personal info Message-ID: Through the api Is there a way besides getting a friend's name and id - get some personal info (i.e. birthday, age, sex, school etc) For example for a_friend in @friends puts a_friend.name puts a_friend.id end Can this be done? Thanks, Michael Tedesco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080227/2b775fb5/attachment-0001.html From uvmarko at gmail.com Wed Feb 27 13:26:41 2008 From: uvmarko at gmail.com (yuval markovich) Date: Wed, 27 Feb 2008 20:26:41 +0200 Subject: [Facebooker-talk] preload_fql Message-ID: <644d91f20802271026h3cf55501h6374d13c2264dded@mail.gmail.com> 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 From shanev at gmail.com Wed Feb 27 13:41:15 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 27 Feb 2008 12:41:15 -0600 Subject: [Facebooker-talk] Anyway to obtain some of your friend's personal info In-Reply-To: References: Message-ID: <4ab757a40802271041nac06036mb0dad97c13ba7380@mail.gmail.com> Yeah, facebook_session.user.birthday facebook_session.user.sex etc.. Shane On Wed, Feb 27, 2008 at 12:05 PM, Michael Tedesco wrote: > > > > > Through the api > > Is there a way besides getting a friend's name and id ? get some personal > info (i.e. birthday, age, sex, school etc) > > > > For example > > for a_friend in @friends > > puts a_friend.name > > puts a_friend.id > > end > > > > Can this be done? > > > > Thanks, Michael Tedesco > _______________________________________________ > 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 From michael.tedesco at peermeta.com Wed Feb 27 13:41:28 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Wed, 27 Feb 2008 13:41:28 -0500 Subject: [Facebooker-talk] Anyway to obtain some of your friend's personal info In-Reply-To: References: Message-ID: Is there a document/api list that shows what you can append/use for fb_profile_ and/or a_friend in friends. -----Original Message----- From: Nicholaus Ames [mailto:nicholaus.l.ames at gmail.com] Sent: Wednesday, February 27, 2008 1:18 PM To: Michael Tedesco Cc: facebooker-talk at rubyforge.org Subject: Re: [Facebooker-talk] Anyway to obtain some of your friend's personal info check out the facebooker app on facebook http://apps.facebook.com/facebooker_tutorial/getting_started/look_at_user_data On Wed, Feb 27, 2008 at 10:05 AM, Michael Tedesco wrote: > > > > > Through the api > > Is there a way besides getting a friend's name and id - get some personal > info (i.e. birthday, age, sex, school etc) > > > > For example > > for a_friend in @friends > > puts a_friend.name > > puts a_friend.id > > end > > > > Can this be done? > > > > Thanks, Michael Tedesco > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- Nicholaus Ames 503-544-5813 ri.niculo.us From michael.tedesco at peermeta.com Wed Feb 27 13:45:53 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Wed, 27 Feb 2008 13:45:53 -0500 Subject: [Facebooker-talk] Anyway to obtain some of your friend's personal info In-Reply-To: <4ab757a40802271041nac06036mb0dad97c13ba7380@mail.gmail.com> References: <4ab757a40802271041nac06036mb0dad97c13ba7380@mail.gmail.com> Message-ID: Oh Cool: Thanks Shane it works for Friends as well -----Original Message----- From: Shane Vitarana [mailto:shanev at gmail.com] Sent: Wednesday, February 27, 2008 1:41 PM To: Michael Tedesco Cc: facebooker-talk at rubyforge.org Subject: Re: [Facebooker-talk] Anyway to obtain some of your friend's personal info Yeah, facebook_session.user.birthday facebook_session.user.sex etc.. Shane On Wed, Feb 27, 2008 at 12:05 PM, Michael Tedesco wrote: > > > > > Through the api > > Is there a way besides getting a friend's name and id - get some personal > info (i.e. birthday, age, sex, school etc) > > > > For example > > for a_friend in @friends > > puts a_friend.name > > puts a_friend.id > > end > > > > Can this be done? > > > > Thanks, Michael Tedesco > _______________________________________________ > 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 From shanev at gmail.com Wed Feb 27 13:51:50 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 27 Feb 2008 12:51:50 -0600 Subject: [Facebooker-talk] preload_fql In-Reply-To: <644d91f20802271026h3cf55501h6374d13c2264dded@mail.gmail.com> References: <644d91f20802271026h3cf55501h6374d13c2264dded@mail.gmail.com> Message-ID: <4ab757a40802271051k31b9294ale71c382f467c95d4@mail.gmail.com> 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 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 From uvmarko at gmail.com Wed Feb 27 14:21:27 2008 From: uvmarko at gmail.com (yuval markovich) Date: Wed, 27 Feb 2008 21:21:27 +0200 Subject: [Facebooker-talk] preload_fql In-Reply-To: References: <644d91f20802271026h3cf55501h6374d13c2264dded@mail.gmail.com> Message-ID: <644d91f20802271121y7c9c4d75o7e2db093dc9c0a43@mail.gmail.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 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 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 > > > > > > From michael.tedesco at peermeta.com Wed Feb 27 17:32:51 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Wed, 27 Feb 2008 17:32:51 -0500 Subject: [Facebooker-talk] Is mobile Phone Number Part of the profile Message-ID: Hi: Does anyone know if mobile phone is part of a profile field of the user and if so what is it called? I"ve tried "mobile" and "mobile_phone" with no success --Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080227/3fb8d27e/attachment.html From joel at i5labs.com Wed Feb 27 19:37:39 2008 From: joel at i5labs.com (Joel Watson) Date: Wed, 27 Feb 2008 16:37:39 -0800 Subject: [Facebooker-talk] facebook_url_rewriting.rb Message-ID: <43A02353-93C4-434D-AC9A-AB85ECABE669@i5labs.com> Hi all! Just curious if that namespace support had been added as discussed in a previous thread using this name. I've currently got my facebook app's controllers inside a subfolder named "facebook" and my callback url looks something like "http://app-domain.com/facebook/". Routes are set up appropriately to direct facebook/:action url's to the appropriate controller. Unfortunately, my callback url is being prepended to my javascript/stylesheet includes in the main (non- facebook) part of the app giving me something like this for each stylesheet/javascript include: ActionController::RoutingError (No route matches "/facebook// stylesheets/groups.css" with {:canvas=>false, :method=>:get}) It's entirely possible that I've just horribly misconfigured something. If so, hopefully someone out there has some ideas. :-) Thanks! -Joel From shanev at gmail.com Wed Feb 27 19:50:41 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 27 Feb 2008 18:50:41 -0600 Subject: [Facebooker-talk] facebook_url_rewriting.rb In-Reply-To: <43A02353-93C4-434D-AC9A-AB85ECABE669@i5labs.com> References: <43A02353-93C4-434D-AC9A-AB85ECABE669@i5labs.com> Message-ID: <4ab757a40802271650o30ba51d7rc13b3b4db2b189df@mail.gmail.com> Joel- I've been meaning to do it using Shawn's patch but didn't get around to it yet. It's on my todo list, but if anyone else has a need for it and does it, it'll be much appreciated. Shane On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson wrote: > Hi all! > > Just curious if that namespace support had been added as discussed in > a previous thread using this name. I've currently got my facebook > app's controllers inside a subfolder named "facebook" and my callback > url looks something like "http://app-domain.com/facebook/". Routes are > set up appropriately to direct facebook/:action url's to the > appropriate controller. Unfortunately, my callback url is being > prepended to my javascript/stylesheet includes in the main (non- > facebook) part of the app giving me something like this for each > stylesheet/javascript include: > > ActionController::RoutingError (No route matches "/facebook// > stylesheets/groups.css" with {:canvas=>false, :method=>:get}) > > It's entirely possible that I've just horribly misconfigured > something. If so, hopefully someone out there has some ideas. :-) > > Thanks! > > -Joel > _______________________________________________ > 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 From shanev at gmail.com Wed Feb 27 19:59:40 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 27 Feb 2008 18:59:40 -0600 Subject: [Facebooker-talk] RESTful Delete In-Reply-To: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> References: <2D7786CB-48EF-4DE0-ABFD-884EB3CDFA40@hwrd.com> Message-ID: <4ab757a40802271659q269ce311r1715301f1bb7b6f@mail.gmail.com> Does it work if you change it to a form with a button and use :html => { :method => :delete } ? Shane On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein wrote: > I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the 'delete', it calls the 'show' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > 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 From jnylund at yahoo.com Wed Feb 27 21:15:08 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Wed, 27 Feb 2008 21:15:08 -0500 Subject: [Facebooker-talk] facebook_url_rewriting.rb In-Reply-To: <4ab757a40802271650o30ba51d7rc13b3b4db2b189df@mail.gmail.com> References: <43A02353-93C4-434D-AC9A-AB85ECABE669@i5labs.com> <4ab757a40802271650o30ba51d7rc13b3b4db2b189df@mail.gmail.com> Message-ID: <55DEA0C9-B908-4F81-B8F2-032774BA35C5@yahoo.com> Ive been using Shawns patch for a while and it works great, what can I do to help Shane? Just change the var name and submit to sourceforge? thanks Joel Nylund (the other Joel) On Feb 27, 2008, at 7:50 PM, Shane Vitarana wrote: > Joel- > > I've been meaning to do it using Shawn's patch but didn't get around > to it yet. It's on my todo list, but if anyone else has a need for it > and does it, it'll be much appreciated. > > Shane > > On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson wrote: >> Hi all! >> >> Just curious if that namespace support had been added as discussed in >> a previous thread using this name. I've currently got my facebook >> app's controllers inside a subfolder named "facebook" and my callback >> url looks something like "http://app-domain.com/facebook/". Routes >> are >> set up appropriately to direct facebook/:action url's to the >> appropriate controller. Unfortunately, my callback url is being >> prepended to my javascript/stylesheet includes in the main (non- >> facebook) part of the app giving me something like this for each >> stylesheet/javascript include: >> >> ActionController::RoutingError (No route matches "/facebook// >> stylesheets/groups.css" with {:canvas=>false, :method=>:get}) >> >> It's entirely possible that I've just horribly misconfigured >> something. If so, hopefully someone out there has some ideas. :-) >> >> Thanks! >> >> -Joel >> _______________________________________________ >> 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 > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk From shanev at gmail.com Wed Feb 27 22:40:19 2008 From: shanev at gmail.com (Shane Vitarana) Date: Wed, 27 Feb 2008 21:40:19 -0600 Subject: [Facebooker-talk] facebook_url_rewriting.rb In-Reply-To: <55DEA0C9-B908-4F81-B8F2-032774BA35C5@yahoo.com> References: <43A02353-93C4-434D-AC9A-AB85ECABE669@i5labs.com> <4ab757a40802271650o30ba51d7rc13b3b4db2b189df@mail.gmail.com> <55DEA0C9-B908-4F81-B8F2-032774BA35C5@yahoo.com> Message-ID: <4ab757a40802271940s2357d545sf1ab0fa80c470d59@mail.gmail.com> Hey the other Joel :) Yup, the var name change, and tests have to be added that covers the change. Then submit it to Rubyforge. On Wed, Feb 27, 2008 at 8:15 PM, Joel Nylund wrote: > Ive been using Shawns patch for a while and it works great, what can I > do to help Shane? Just change the var name and submit to sourceforge? > > thanks > Joel Nylund (the other Joel) > > > > On Feb 27, 2008, at 7:50 PM, Shane Vitarana wrote: > > > > > Joel- > > > > I've been meaning to do it using Shawn's patch but didn't get around > > to it yet. It's on my todo list, but if anyone else has a need for it > > and does it, it'll be much appreciated. > > > > Shane > > > > On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson wrote: > >> Hi all! > >> > >> Just curious if that namespace support had been added as discussed in > >> a previous thread using this name. I've currently got my facebook > >> app's controllers inside a subfolder named "facebook" and my callback > >> url looks something like "http://app-domain.com/facebook/". Routes > >> are > >> set up appropriately to direct facebook/:action url's to the > >> appropriate controller. Unfortunately, my callback url is being > >> prepended to my javascript/stylesheet includes in the main (non- > >> facebook) part of the app giving me something like this for each > >> stylesheet/javascript include: > >> > >> ActionController::RoutingError (No route matches "/facebook// > >> stylesheets/groups.css" with {:canvas=>false, :method=>:get}) > >> > >> It's entirely possible that I've just horribly misconfigured > >> something. If so, hopefully someone out there has some ideas. :-) > >> > >> Thanks! > >> > >> -Joel > >> _______________________________________________ > >> 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 > > _______________________________________________ > > 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 From ahmad at 360in.com Wed Feb 27 23:59:49 2008 From: ahmad at 360in.com (Ahmad AbdulLateef) Date: Thu, 28 Feb 2008 10:29:49 +0530 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <9484DB2F-032E-4834-B6C8-D56A4AD199E3@yahoo.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> <99a6c1ee0802270116q7fff57eerc1a5a06037174664@mail.gmail.com> <9484DB2F-032E-4834-B6C8-D56A4AD199E3@yahoo.com> Message-ID: <99a6c1ee0802272059v3f9b6efew730864be4ee03452@mail.gmail.com> Im using IFrame and not FBML. Does tat make a difference? On Wed, Feb 27, 2008 at 8:15 PM, Joel Nylund wrote: > Hi Ahmad, > Im guessing you have something wrong with your configuration either on > facebook or in your facebooker.yml file. > > make sure your facebook configs of Canvas Page URL("AhmadTestApp") match > the canvas_page_name in facebooker.yml (in correct section) > make sure your setup to fbml & website > > How are you accessing your application (what url?) - for facebooker setup > with canvas & fbml you need to be going via > http://apps.facebook.com/yourapp > > which version of facebooker do you have? which version rails do you have? > > I put directions to get a basic working version of facebooker going here: > (they are 1.2.x rails directions, but they should work in 2.x) > > http://jnylund.typepad.com/joels_blog/2008/01/facebooker-gett.html > > Also Davids tutorial should help as well. > > Joel > > > On Feb 27, 2008, at 4:16 AM, Ahmad AbdulLateef wrote: > > Well tats not my problem. Its like when I include > ensure_application_is_installed_by_facebook_user at times I get this error > Facebooker::Session::IncorrectSignature and other times I get redirected to > the Install page which says > > You've already added AhmadTestApp to your Facebook applications. > Visit the My Applications page to > adjust your settings or remove this app. > I have unfrtunately a bad time with facebooer :-( . Can anyone please zip > a basic working hello world facebooker app which includes > ensure_application_is_installed_by_facebook_user. So tat I can look at where > I messed up or find out if its gotta do with my system perse. > > Any help would be largely appreciated. > > On Tue, Feb 26, 2008 at 9:20 PM, Michael Niessner < > mniessner at elevatedrails.com> wrote: > > > You could add the following to you application controller. > > def application_is_not_installed_by_facebook_user > > redirect_to session[:facebook_session].install_url(:next => > > request.request_uri) > > end > > > > This tells facebooker you want to redirect to the install url and set > > the next param to the original request when the application is not > > installed. After the user completes the install page facebook will redirect > > to the next param. > > > > Michael Niessner > > > > On Feb 25, 2008, at 5:59 AM, Ahmad AbdulLateef wrote: > > > > Hi guys, > > > > I'm just getting started with facebooker. I got a nasty problem. Every > > request redirects to facebook for authentication because i have included > > > > ensure_authenticated_to_facebook and oce the authentication is over I'm > > redirected back to the callback URL. The original requested URL is lost. I > > suspected of not using DB sessions, but I'm using DB as the session store. > > > > > > Please help me out. How do I avoid redirects > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > -- > Regards > Ahmad > Software Architect > Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | > Skype:ahmadifx _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > -- Regards Ahmad Software Architect Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | Skype:ahmadifx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080228/758adbbb/attachment.html From jnylund at yahoo.com Thu Feb 28 10:44:41 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Thu, 28 Feb 2008 10:44:41 -0500 Subject: [Facebooker-talk] Abnormal Redirects In-Reply-To: <99a6c1ee0802272059v3f9b6efew730864be4ee03452@mail.gmail.com> References: <99a6c1ee0802250355y25aef5bfu19428ee87467c1bd@mail.gmail.com> <99a6c1ee0802250359y541dc93bq76c1e3134f7895e9@mail.gmail.com> <2BFD391F-4CFA-49C9-A557-D9C3F984C3BE@gmail.com> <99a6c1ee0802270116q7fff57eerc1a5a06037174664@mail.gmail.com> <9484DB2F-032E-4834-B6C8-D56A4AD199E3@yahoo.com> <99a6c1ee0802272059v3f9b6efew730864be4ee03452@mail.gmail.com> Message-ID: I think so, can one of the core developers let us know what the state of iframe support for facebooker is? I haven't used iframe before, but my understanding of the way it works, is on the first call to the iframe you will get the fb_sig stuff, including "fb_sig_in_iframe"=>"1", but once you are in your iframe and clicking around, its your app directly, so there will be no fb_sig parms passed like in a canvas application. So adding the "ensure" filters to every call would definitely hose you up, because once you click anylink inside your iframe, you dont have the params to make these fitlers happy. So my suggestion unless there is some built in support is have a defined entry point to your application, and add the ensure filters just for that entry controller/method, put something in your session that knows they have fb installed & authenticated (presumably using your built in auth), then use your regular auth stuff for filtering all other requests. Make sense? My understanding of iframe is its great if you have a large complex existing application you dont want to rewrite, you can just plug it in, but the integration with facebook features is harder (api calls are just as easy, but the other stuff is harder). If you have a new application, fbml/canvas is more tightly integrated, and you get look & feel of facebook app, but learning curve is there to learn fmbl, but the facebooker guys make this easier by providing rails helpers to do lots of this stuff for you. I have a large complex existing application but have decided to go the fbml/canvas route anyway since it gives a better integration experience for the end user, besides if you have a fairly descent rails app its really jut building a new view for it. Joel On Feb 27, 2008, at 11:59 PM, Ahmad AbdulLateef wrote: > Im using IFrame and not FBML. Does tat make a difference? > > On Wed, Feb 27, 2008 at 8:15 PM, Joel Nylund > wrote: > Hi Ahmad, > > Im guessing you have something wrong with your configuration either > on facebook or in your facebooker.yml file. > > make sure your facebook configs of Canvas Page URL("AhmadTestApp") > match the canvas_page_name in facebooker.yml (in correct section) > make sure your setup to fbml & website > > How are you accessing your application (what url?) - for facebooker > setup with canvas & fbml you need to be going via http://apps.facebook.com/yourapp > > which version of facebooker do you have? which version rails do you > have? > > I put directions to get a basic working version of facebooker going > here: (they are 1.2.x rails directions, but they should work in 2.x) > > http://jnylund.typepad.com/joels_blog/2008/01/facebooker-gett.html > > Also Davids tutorial should help as well. > > Joel > > > On Feb 27, 2008, at 4:16 AM, Ahmad AbdulLateef wrote: > >> Well tats not my problem. Its like when I include >> ensure_application_is_installed_by_facebook_user at times I get >> this error Facebooker::Session::IncorrectSignature and other times >> I get redirected to the Install page which says >> >> You've already added AhmadTestApp to your Facebook applications. >> Visit the My Applications page to adjust your settings or remove >> this app. >> I have unfrtunately a bad time with facebooer :-( . Can anyone >> please zip a basic working hello world facebooker app which >> includes ensure_application_is_installed_by_facebook_user. So tat I >> can look at where I messed up or find out if its gotta do with my >> system perse. >> >> Any help would be largely appreciated. >> >> On Tue, Feb 26, 2008 at 9:20 PM, Michael Niessner > > wrote: >> You could add the following to you application controller. >> >> def application_is_not_installed_by_facebook_user >> redirect_to session[:facebook_session].install_url(:next => >> request.request_uri) >> end >> >> This tells facebooker you want to redirect to the install url and >> set the next param to the original request when the application is >> not installed. After the user completes the install page facebook >> will redirect to the next param. >> >> Michael Niessner >> >> On Feb 25, 2008, at 5:59 AM, Ahmad AbdulLateef wrote: >> >>> Hi guys, >>> >>> I'm just getting started with facebooker. I got a nasty problem. >>> Every request redirects to facebook for authentication because i >>> have included >>> ensure_authenticated_to_facebook and oce the authentication is >>> over I'm redirected back to the callback URL. The original >>> requested URL is lost. I suspected of not using DB sessions, but >>> I'm using DB as the session store. >>> >>> >>> Please help me out. How do I avoid redirects >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> >> >> -- >> Regards >> Ahmad >> Software Architect >> Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | >> Skype:ahmadifx _______________________________________________ >> >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > -- > Regards > Ahmad > Software Architect > Equvia Webservices | +919840126833 | MSN: ahmadifx at hotmail.com | > Skype:ahmadifx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080228/927c90f9/attachment-0001.html From michael.tedesco at peermeta.com Fri Feb 29 11:58:45 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Fri, 29 Feb 2008 11:58:45 -0500 Subject: [Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions Message-ID: Hi I am trying to set-up My facebook app to use infininite sessions. I saw the following link that used the old RFacebook libraries http://www.atnan.com/2007/6/18/updating-facebook-profiles-and-feeds-with-rfacebook Does anyone know of a sample app or example that does the same thing using facebooker and can provide Part of the controller code to do something like it. n Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080229/5c6a1a90/attachment.html From chris at cobaltedge.com Fri Feb 29 12:28:12 2008 From: chris at cobaltedge.com (Christopher Bailey) Date: Fri, 29 Feb 2008 09:28:12 -0800 Subject: [Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions In-Reply-To: References: Message-ID: <443c240c0802290928q45602227kccd1a2cdf72d5e88@mail.gmail.com> I haven't looked at the app you mention, but the approach I take is just to store the session key, if it's infinite, with the user's DB record. That way, at any time, whether they're in Facebook or not, I can update their profile FBML or send messages to the mini-feed etc. Basically, I just set up a before_filter on my Facebook controller, and in that it does a few specific things for our own app, but then calls the following which stores the key: def handle_infinite_session if facebook_session.infinite? if logged_in_user.facebook_session_key != facebook_session.session_key logged_in_user.update_attribute(:facebook_session_key, facebook_session.session_key) end else logger.warn "Non-infinite session key for Facebook session:\n" + " Facebook user ID: #{facebook_user.id}\n" + " Our user ID: #{logged_in_user.id}" end end On 2/29/08, Michael Tedesco wrote: > > Hi I am trying to set-up > > My facebook app to use infininite sessions. > > > > I saw the following link that used the old RFacebook libraries > > > http://www.atnan.com/2007/6/18/updating-facebook-profiles-and-feeds-with-rfacebook > > > > Does anyone know of a sample app or example that does the same thing > using facebooker and can provide > > Part of the controller code to do something like it. > > > > n Thanks, Mike > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080229/9bafb0fa/attachment.html From chris at cobaltedge.com Fri Feb 29 14:41:40 2008 From: chris at cobaltedge.com (Christopher Bailey) Date: Fri, 29 Feb 2008 11:41:40 -0800 Subject: [Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions In-Reply-To: References: <443c240c0802290928q45602227kccd1a2cdf72d5e88@mail.gmail.com> <443c240c0802291013y4ea0f739gc6ec088381d7c770@mail.gmail.com> Message-ID: <443c240c0802291141s409924aev3279581aa5f67ead@mail.gmail.com> The Facebooker callback (ensure_...) will depend on what you need to do. I think in your case, you may need to do the installed one so that you are ok with getting their session key and storing it. But, honestly, I don't know - you need to check the terms of use as to whether you are allowed to do things with a user session if they don't have your app installed. But, the infinite session key, I believe, is independent of your app install (someone else can likely comment better on that, as I'm still somewhat new to Facebook and Facebooker and all these issues). For your second question, that looks about right. What I have found in my testing so far, is that I am always getting an infinite session key, and not even just when the user first installs the app, it seems to always be an infinite session. I don't know if this is because I'm interacting via my Facebook app, or what (the Facebook documentation doesn't imply that it's always infinite, and further implies, at least to me, that it is not infinite beyond the workflow of adding your app, that's why I have some of the logic I have to only update the key if it's infinite and if it's changed, etc.). In the end, what you have is good - whereby if you don't have an infinite, you can use that magic URL they supply to ask the user to grant one to your app. This is a bit messy user interface/experience wise, but it may be what you have to do if you don't have an infinite session key for whatever reason. On 2/29/08, Michael Tedesco wrote: > > My fault Chris, the below answers some of my questions thanks, but maybe > I can elaborate further. > > Here's my thoughts > > > > 2 Basic questions > > 1) Does "ensure_authenticated_to_facebook " return a > permanent session key as well.? > > Is the advantage like you said below using below using the other > ensure_ method you gave means it only has to happen once? Right > > > > ensure_application_is_installed_by_facebook_user # this also ensures > they're logged in to FB > > vs > > ensure_authenticated_to_facebook > > > > before_filter :sync_facebook_and_our_users > > > > 2) When I create the before_filter as you say > > > > Is this the order of my action going to be something like the following > below, because based on the doc if I have users that have expiring sessions > and I want to create a non expiring one, > > I need to forward to > > http://www.facebook.com/code_gen.php?v=1.0&api_key=YOUR_API_KEY > > > > *pardon for the psudo code* > > > > *sync_facebook_and_our_users* > > a) obtain fb user from facebook_session i.e at user = > facebook_session.user > > b) Check if the user has a > > perm session entry in the DB > > If so, use it and continue? > > Otherwise, > > If not stored send user to the following to generate a non expiring > key? as directed in Doc > http://www.facebook.com/code_gen.php?v=1.0&api_key=YOUR_API_KEY > > Make a call to facebook.auth.getSession (store this new session in DB > for user) > > Continue? > > > > > > end > > > > What do you think Christopher, am I on the right track? > > > > > > *From:* Christopher Bailey [mailto:chris at cobaltedge.com] > *Sent:* Friday, February 29, 2008 1:13 PM > *To:* Michael Tedesco > *Subject:* Re: [Facebooker-talk] Does anyone have an example of using > facebooker with Infinite Sessions > > > > I might not be understanding what you're after. In my controller, I do: > > > > class FacebookController < ApplicationController > ensure_application_is_installed_by_facebook_user # this also ensures > they're logged in to FB > > before_filter :sync_facebook_and_our_users > ... > > > > Generally what's happening here, is when the user first adds your app on > Facebook, you will see this infinite session key, store it along with their > user record in your own DB, and then never have to worry about it again. > Then, your application, can update the user's profile or whatever, at any > time - regardless of whether the user is logged in, or even if that user is > using your application (whether inside Facebook or outside facebook). > > > > For example, we have user's who belong to groups, in our own web app. If > a project within that group completes, say by user A's actions, well, we can > still update the FB profile of all user's of that group to indicate the > project is done, because we have their infinite session keys. So, at some > random point in your application, you can do something like: > > > > fb_session = Facebooker::Session.create > > fb_session.secure_with!(self.facebook_session_key, self.facebook_user_id, > 0) > > fb_session.user.profile_fbml = > > > > My apologies if I'm not understand what you're after or need. > > > > > > On 2/29/08, *Michael Tedesco* wrote: > > Hi Chris thanks, > > But any insight based on the auth document below, to work with the > call suggested in option 2 and to work with a before_filter using the > ensure_authenticated_to_facebook method. > > I'd like to store an infinite session regardless. > > http://developers.facebook.com/documentation.php?v=1.0&doc=auth > > > > > > *From:* Christopher Bailey [mailto:chris at cobaltedge.com] > *Sent:* Friday, February 29, 2008 12:28 PM > *To:* Michael Tedesco > *Cc:* facebooker-talk at rubyforge.org > *Subject:* Re: [Facebooker-talk] Does anyone have an example of using > facebooker with Infinite Sessions > > > > I haven't looked at the app you mention, but the approach I take is just > to store the session key, if it's infinite, with the user's DB record. That > way, at any time, whether they're in Facebook or not, I can update their > profile FBML or send messages to the mini-feed etc. Basically, I just set > up a before_filter on my Facebook controller, and in that it does a few > specific things for our own app, but then calls the following which stores > the key: > > > > def handle_infinite_session > > if facebook_session.infinite? > > if logged_in_user.facebook_session_key != > facebook_session.session_key > > logged_in_user.update_attribute(:facebook_session_key, > facebook_session.session_key) > > end > > else > > logger.warn "Non-infinite session key for Facebook session:\n" + > > " Facebook user ID: #{facebook_user.id}\n" + > > " Our user ID: #{logged_in_user.id}" > > end > > end > > > > > > On 2/29/08, *Michael Tedesco* wrote: > > Hi I am trying to set-up > > My facebook app to use infininite sessions. > > > > I saw the following link that used the old RFacebook libraries > > > http://www.atnan.com/2007/6/18/updating-facebook-profiles-and-feeds-with-rfacebook > > > > Does anyone know of a sample app or example that does the same thing > using facebooker and can provide > > Part of the controller code to do something like it. > > > > n Thanks, Mike > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com > > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com > -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080229/5cea16f4/attachment-0001.html From michael.tedesco at peermeta.com Fri Feb 29 16:04:39 2008 From: michael.tedesco at peermeta.com (Michael Tedesco) Date: Fri, 29 Feb 2008 16:04:39 -0500 Subject: [Facebooker-talk] Quick Question Message-ID: Hi: 1) Can someone tell me if there is a way to output when a facebooker session will expire. I see an expired? Method but nothing to output a date or anything n Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080229/08041117/attachment.html From joel at i5labs.com Fri Feb 29 16:37:25 2008 From: joel at i5labs.com (Joel Watson) Date: Fri, 29 Feb 2008 13:37:25 -0800 Subject: [Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions In-Reply-To: <443c240c0802290928q45602227kccd1a2cdf72d5e88@mail.gmail.com> References: <443c240c0802290928q45602227kccd1a2cdf72d5e88@mail.gmail.com> Message-ID: I do something similar in my app. To reinstantiate the session, I created a user method as follows: def restore_facebook_session return @facebook_session unless @facebook_session.nil? @facebook_session = Facebooker::Session.create(Facebooker::Session.api_key, Facebooker::Session.secret_key) @facebook_session.secure_with!(facebook_session_key, facebook_uid, 0) @facebook_session end I then use it as follows in the observer I have set up to update the user's profile: def update_profile_fbml(membership) user = membership.user facebook_session = user.restore_facebook_session FacebookPublisher.deliver_profile_update(facebook_session.user, user) end Which is called like so: def after_create(membership) update_profile_fbml(membership) end def after_destroy(membership) update_profile_fbml(membership) end Some background. The app has users that can join groups (which are associated through memberships). These group memberships are then displayed in the user's Facebook profile. So, whenever a membership is created or destroyed, their Facebook profile is updated accordingly. I wasn't sure if there was a standard way of reinstantiating the session, so I tinkered around until I got the method shown above. If there's a better way to do it, please speak up. :-) -Joel On Feb 29, 2008, at 9:28 AM, Christopher Bailey wrote: > I haven't looked at the app you mention, but the approach I take is > just to store the session key, if it's infinite, with the user's DB > record. That way, at any time, whether they're in Facebook or not, > I can update their profile FBML or send messages to the mini-feed > etc. Basically, I just set up a before_filter on my Facebook > controller, and in that it does a few specific things for our own > app, but then calls the following which stores the key: > > def handle_infinite_session > if facebook_session.infinite? > if logged_in_user.facebook_session_key != > facebook_session.session_key > logged_in_user.update_attribute(:facebook_session_key, > facebook_session.session_key) > end > else > logger.warn "Non-infinite session key for Facebook session:\n" + > " Facebook user ID: #{facebook_user.id}\n" + > " Our user ID: #{logged_in_user.id}" > end > end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080229/76dc82dd/attachment.html