From jonathan.otto at gmail.com Tue Apr 1 02:58:57 2008 From: jonathan.otto at gmail.com (Jonathan Otto) Date: Tue, 1 Apr 2008 01:58:57 -0500 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> Message-ID: Mike - 1) Is the point of making them (the API URLs - currently constants) class methods so they can be more readily changed - as in after the plugin is loaded and during program execution? If it is not, I don't see why my above code wouldn't suffice. 2) If you guys plan on letting these URLs change during program execution, how will you detect what API to set the configuration for? The POST params might be the same (At least I suspect they are the same for Bebo and Facebook, Ringside however does have some unique additions). 3) What are magic constants? 4) Could you give more detail on this? "We should take every magic constant and turn it into a call on the session." On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino wrote: > Why not just make the constants be class methods on the session? Then > you just need to worry about creating the right kind of session and > all of the other calls will magically work. Does that sound sane? > > We should take every magic constant and turn it into a call on the > session. > > Mike > > > > On Mar 31, 2008, at 5:57 PM, David Clements wrote: > > For Bebo, I subclassed Facebooker::Session into a BeboSession. And > > then monkey patched all the calls that use constants. The ENV > > approach doesn't work for Bebo since iI am running Facebook and Bebo > > and Web in the same app. > > > > I have been thinking that this could be generalized more possibly into > > facebooker.yml or some other YAML. I was thinking that the whole > > configuration could be keyed off of the api_key that gets sent with > > the request. That way you could actually run more than one facebook > > app in the same rails instance. > > > > How does this Ringside Networks work? Do you assign an API KEY? > > > > Thanks, > > > > Dave > > > > > > On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > > > >> Dave, since the URLs will no longer be static are you still using > >> ruby > >> constants to store the URLs? Right now I am grabbing the URL > >> configuration from facebooker.yml and storing them into the ENV > >> constant array at the end of init.rb. > >> > >> But this doesn't work during tests. > >> > >> For example in session_test.rb's setup method, I set the ENV array > >> (like I do in init.rb) right before calling the > >> Facebook::Session.create, but the Facebooker::Session class can't see > >> ENV. I'm assuming there is a better way of handling this. Let me know > >> if any of you have any suggestions. I'll complete the test. > >> > >> These are the constants I am talking about: > >> > >> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > >> "apps.facebook.com" > >> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > >> "api.facebook.com" > >> API_PATH_REST = ENV['API_PATH_REST'] || "/ > >> restserver.php" > >> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || "www.facebook.com > >> " > >> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || "/login.php" > >> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > >> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > >> install.php" > >> > >> Right now that code is in session.rb. It seems the best way to do > >> this > >> is to allow people to set these parameters in the facebooker.yml > >> optionally, and if they are not set then it defaults to Facebook > >> addresses. I just don't know the best way to make the configuration > >> portable. > >> > >> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > >> wrote: > >>> Can you submit this as a patch, with tests, I have a bebo > >>> adapter that I > >>> have been working on so I can take a look and see if it fits in > >>> with that, > >>> as I have had similar issues. > >>> > >>> Dave > >>> > >>> > >>> > >>> > >>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto >>>> > >>> wrote: > >>>> > >>>> > >>>> > >>>> I am requesting that we change the paths that absolutely point to > >>>> the > >>>> facebook URL. > >>>> > >>>> In the PHP client there is a method in the facebook.php file called > >>>> get_facebook_url() so this is easy to change there. > >>>> > >>>> One reason for this: > >>>> > >>>> Ringside Networks is a drop in replacement for Facebook that can be > >>>> used for localhost development and eventually an abstraction for > >>>> most > >>>> social networks - it mimics the Facebook API so the Facebooker > >>>> client > >>>> works except for the URLs pointing to the Facebook domain. I have > >>>> changes ready if Mike Mangino or anyone else is willing to commit > >>>> them. > >>>> > >>>> http://wiki.ringsidenetworks.org/display/ringside/Home > >>>> _______________________________________________ > >>>> 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 mmangino at elevatedrails.com Tue Apr 1 09:23:36 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Tue, 1 Apr 2008 08:23:36 -0500 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> Message-ID: <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > Mike - > > 1) Is the point of making them (the API URLs - currently constants) > class methods so they can be more readily changed - as in after the > plugin is loaded and during program execution? If it is not, I don't > see why my above code wouldn't suffice. > They would change based upon the type of session used. Facebook will not change their API url during execution, so there is no need for that to change during requests. Each different container will have it's own session object. > 2) If you guys plan on letting these URLs change during program > execution, how will you detect what API to set the configuration for? > The POST params might be the same (At least I suspect they are the > same for Bebo and Facebook, Ringside however does have some unique > additions). You need some way to tell what site you are talking to. Facebook and Bebo have different parameters. Bebo uses sn_* where facebook uses fb_*. Each container will need to provide a way of determining if the request is for them. Once a session is active, the stored session will tell you what you need to know. > > > 3) What are magic constants? > By magic constants, I mean strings in the API. For instance some methods cal session.post on "facebook.users.user_getInfo", that is a magic constant. Instead, it should be session.post(:user_get_info) or something similar. Then, the user can look up what API key it needs to use for that platform. > 4) Could you give more detail on this? "We should take every magic > constant and turn it into a call on the > session." > I explained this one above. Mike > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > wrote: >> Why not just make the constants be class methods on the session? Then >> you just need to worry about creating the right kind of session and >> all of the other calls will magically work. Does that sound sane? >> >> We should take every magic constant and turn it into a call on the >> session. >> >> Mike >> >> >> >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. And >>> then monkey patched all the calls that use constants. The ENV >>> approach doesn't work for Bebo since iI am running Facebook and Bebo >>> and Web in the same app. >>> >>> I have been thinking that this could be generalized more possibly >>> into >>> facebooker.yml or some other YAML. I was thinking that the whole >>> configuration could be keyed off of the api_key that gets sent with >>> the request. That way you could actually run more than one facebook >>> app in the same rails instance. >>> >>> How does this Ringside Networks work? Do you assign an API KEY? >>> >>> Thanks, >>> >>> Dave >>> >>> >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: >>> >>>> Dave, since the URLs will no longer be static are you still using >>>> ruby >>>> constants to store the URLs? Right now I am grabbing the URL >>>> configuration from facebooker.yml and storing them into the ENV >>>> constant array at the end of init.rb. >>>> >>>> But this doesn't work during tests. >>>> >>>> For example in session_test.rb's setup method, I set the ENV array >>>> (like I do in init.rb) right before calling the >>>> Facebook::Session.create, but the Facebooker::Session class can't >>>> see >>>> ENV. I'm assuming there is a better way of handling this. Let me >>>> know >>>> if any of you have any suggestions. I'll complete the test. >>>> >>>> These are the constants I am talking about: >>>> >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || >>>> "apps.facebook.com" >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || >>>> "api.facebook.com" >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ >>>> restserver.php" >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || "www.facebook.com >>>> " >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || "/login.php" >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ >>>> install.php" >>>> >>>> Right now that code is in session.rb. It seems the best way to do >>>> this >>>> is to allow people to set these parameters in the facebooker.yml >>>> optionally, and if they are not set then it defaults to Facebook >>>> addresses. I just don't know the best way to make the configuration >>>> portable. >>>> >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements >>>> wrote: >>>>> Can you submit this as a patch, with tests, I have a bebo >>>>> adapter that I >>>>> have been working on so I can take a look and see if it fits in >>>>> with that, >>>>> as I have had similar issues. >>>>> >>>>> Dave >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto >>>>> >>>>> wrote: >>>>>> >>>>>> >>>>>> >>>>>> I am requesting that we change the paths that absolutely point to >>>>>> the >>>>>> facebook URL. >>>>>> >>>>>> In the PHP client there is a method in the facebook.php file >>>>>> called >>>>>> get_facebook_url() so this is easy to change there. >>>>>> >>>>>> One reason for this: >>>>>> >>>>>> Ringside Networks is a drop in replacement for Facebook that >>>>>> can be >>>>>> used for localhost development and eventually an abstraction for >>>>>> most >>>>>> social networks - it mimics the Facebook API so the Facebooker >>>>>> client >>>>>> works except for the URLs pointing to the Facebook domain. I have >>>>>> changes ready if Mike Mangino or anyone else is willing to commit >>>>>> them. >>>>>> >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home >>>>>> _______________________________________________ >>>>>> 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 >> >> >> >> -- Mike Mangino http://www.elevatedrails.com From jonathan.otto at gmail.com Tue Apr 1 17:24:34 2008 From: jonathan.otto at gmail.com (Jonathan Otto) Date: Tue, 1 Apr 2008 16:24:34 -0500 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: I'm close to getting this working in a fairly DRY fashion. First, a few questions and some guidance. Right now I have all the configuration variables loaded from facebooker.yml. You can specify 3 different APIs for each RAILS_ENV - facebook, bebo, or ringside, but if you specify nothing, it defaults to the Facebook configuration. When the plugin is initialized it stores the YAML file into the ENV hash. The plan is that the session object will be created by examining the POST parameters on each request and grabbing the correct configuration from the ENV hash. Other classes needing the information will call @session.apps_url, or @session.www_url etc.. Before I can continue on this route, I need to access the parameters hash. So is there a built in way to access the parameter hash from the session class? I could pass it in everywhere Facebooker::Session.create, or Session.secret_key, etc.. is called, but that would require a few changes in the controller. This seems optimal because it allows each request to your application to respond to requests from Bebo, Facebook, Ringside, or other future APIs without reloading the YAML file. Please provide suggestions, corrections, or guidance. On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino wrote: > > On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > > Mike - > > > > 1) Is the point of making them (the API URLs - currently constants) > > class methods so they can be more readily changed - as in after the > > plugin is loaded and during program execution? If it is not, I don't > > see why my above code wouldn't suffice. > > > > They would change based upon the type of session used. Facebook will > not change their API url during execution, so there is no need for > that to change during requests. Each different container will have > it's own session object. > > > > 2) If you guys plan on letting these URLs change during program > > execution, how will you detect what API to set the configuration for? > > The POST params might be the same (At least I suspect they are the > > same for Bebo and Facebook, Ringside however does have some unique > > additions). > > You need some way to tell what site you are talking to. Facebook and > Bebo have different parameters. Bebo uses sn_* where facebook uses > fb_*. Each container will need to provide a way of determining if the > request is for them. Once a session is active, the stored session will > tell you what you need to know. > > > > > > > > 3) What are magic constants? > > > > By magic constants, I mean strings in the API. For instance some > methods cal session.post on "facebook.users.user_getInfo", that is a > magic constant. Instead, it should be session.post(:user_get_info) or > something similar. Then, the user can look up what API key it needs to > use for that platform. > > > > 4) Could you give more detail on this? "We should take every magic > > constant and turn it into a call on the > > session." > > > > I explained this one above. > > Mike > > > > > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > > wrote: > >> Why not just make the constants be class methods on the session? Then > >> you just need to worry about creating the right kind of session and > >> all of the other calls will magically work. Does that sound sane? > >> > >> We should take every magic constant and turn it into a call on the > >> session. > >> > >> Mike > >> > >> > >> > >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: > >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. And > >>> then monkey patched all the calls that use constants. The ENV > >>> approach doesn't work for Bebo since iI am running Facebook and Bebo > >>> and Web in the same app. > >>> > >>> I have been thinking that this could be generalized more possibly > >>> into > >>> facebooker.yml or some other YAML. I was thinking that the whole > >>> configuration could be keyed off of the api_key that gets sent with > >>> the request. That way you could actually run more than one facebook > >>> app in the same rails instance. > >>> > >>> How does this Ringside Networks work? Do you assign an API KEY? > >>> > >>> Thanks, > >>> > >>> Dave > >>> > >>> > >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > >>> > >>>> Dave, since the URLs will no longer be static are you still using > >>>> ruby > >>>> constants to store the URLs? Right now I am grabbing the URL > >>>> configuration from facebooker.yml and storing them into the ENV > >>>> constant array at the end of init.rb. > >>>> > >>>> But this doesn't work during tests. > >>>> > >>>> For example in session_test.rb's setup method, I set the ENV array > >>>> (like I do in init.rb) right before calling the > >>>> Facebook::Session.create, but the Facebooker::Session class can't > >>>> see > >>>> ENV. I'm assuming there is a better way of handling this. Let me > >>>> know > >>>> if any of you have any suggestions. I'll complete the test. > >>>> > >>>> These are the constants I am talking about: > >>>> > >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > >>>> "apps.facebook.com" > >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > >>>> "api.facebook.com" > >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ > >>>> restserver.php" > >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || "www.facebook.com > >>>> " > >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || "/login.php" > >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > >>>> install.php" > >>>> > >>>> Right now that code is in session.rb. It seems the best way to do > >>>> this > >>>> is to allow people to set these parameters in the facebooker.yml > >>>> optionally, and if they are not set then it defaults to Facebook > >>>> addresses. I just don't know the best way to make the configuration > >>>> portable. > >>>> > >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > >>>> wrote: > >>>>> Can you submit this as a patch, with tests, I have a bebo > >>>>> adapter that I > >>>>> have been working on so I can take a look and see if it fits in > >>>>> with that, > >>>>> as I have had similar issues. > >>>>> > >>>>> Dave > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto >>>>>> > >>>>> wrote: > >>>>>> > >>>>>> > >>>>>> > >>>>>> I am requesting that we change the paths that absolutely point to > >>>>>> the > >>>>>> facebook URL. > >>>>>> > >>>>>> In the PHP client there is a method in the facebook.php file > >>>>>> called > >>>>>> get_facebook_url() so this is easy to change there. > >>>>>> > >>>>>> One reason for this: > >>>>>> > >>>>>> Ringside Networks is a drop in replacement for Facebook that > >>>>>> can be > >>>>>> used for localhost development and eventually an abstraction for > >>>>>> most > >>>>>> social networks - it mimics the Facebook API so the Facebooker > >>>>>> client > >>>>>> works except for the URLs pointing to the Facebook domain. I have > >>>>>> changes ready if Mike Mangino or anyone else is willing to commit > >>>>>> them. > >>>>>> > >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home > >>>>>> _______________________________________________ > >>>>>> 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 > >> > >> > >> > >> > > -- > Mike Mangino > http://www.elevatedrails.com > > > > From digidigo at gmail.com Tue Apr 1 17:39:41 2008 From: digidigo at gmail.com (David Clements) Date: Tue, 1 Apr 2008 15:39:41 -0600 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: Not sure if I am totally following you. In the bebo_adapter I created I overrode the controller method new_facebook_session to create the appropriate session object at the time the request parameters are processed. After you have the appropriate Session object then everything should be able to be contained within that Session object. I don't think you need the params being processed again. What I was going to do is make sure the Facebooker::Sesttion.current_sessionalways hold the correct session. Then if you need to access some configuration, like deep in url_rewriting, you can call Facebooker::Session.current_session.application_base Not sure if that helps. Here are a couple of other issue that might come up. If you are doing any async processing then you will not have an request parameters to go off of so creating the correct session type should be enough to encapsulate all the configuration parameters. This is another reason why may want to process the parameters once and then have everything else go off the current_session object. Hope that helps, I am attaching the bebo_adapter that I have in production right now in case it helps. There are a lot of other places in bebo that the API's don't match up so I have to patch different places in the code. Dave On Tue, Apr 1, 2008 at 3:24 PM, Jonathan Otto wrote: > I'm close to getting this working in a fairly DRY fashion. First, a > few questions and some guidance. > > Right now I have all the configuration variables loaded from > facebooker.yml. You can specify 3 different APIs for each RAILS_ENV - > facebook, bebo, or ringside, but if you specify nothing, it defaults > to the Facebook configuration. When the plugin is initialized it > stores the YAML file into the ENV hash. > > The plan is that the session object will be created by examining the > POST parameters on each request and grabbing the correct configuration > from the ENV hash. Other classes needing the information will call > @session.apps_url, or @session.www_url etc.. > > Before I can continue on this route, I need to access the parameters > hash. So is there a built in way to access the parameter hash from the > session class? I could pass it in everywhere > Facebooker::Session.create, or Session.secret_key, etc.. is called, > but that would require a few changes in the controller. > > This seems optimal because it allows each request to your application > to respond to requests from Bebo, Facebook, Ringside, or other future > APIs without reloading the YAML file. > > Please provide suggestions, corrections, or guidance. > > On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino > wrote: > > > > On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > > > Mike - > > > > > > 1) Is the point of making them (the API URLs - currently constants) > > > class methods so they can be more readily changed - as in after the > > > plugin is loaded and during program execution? If it is not, I don't > > > see why my above code wouldn't suffice. > > > > > > > They would change based upon the type of session used. Facebook will > > not change their API url during execution, so there is no need for > > that to change during requests. Each different container will have > > it's own session object. > > > > > > > 2) If you guys plan on letting these URLs change during program > > > execution, how will you detect what API to set the configuration for? > > > The POST params might be the same (At least I suspect they are the > > > same for Bebo and Facebook, Ringside however does have some unique > > > additions). > > > > You need some way to tell what site you are talking to. Facebook and > > Bebo have different parameters. Bebo uses sn_* where facebook uses > > fb_*. Each container will need to provide a way of determining if the > > request is for them. Once a session is active, the stored session will > > tell you what you need to know. > > > > > > > > > > > > > 3) What are magic constants? > > > > > > > By magic constants, I mean strings in the API. For instance some > > methods cal session.post on "facebook.users.user_getInfo", that is a > > magic constant. Instead, it should be session.post(:user_get_info) or > > something similar. Then, the user can look up what API key it needs to > > use for that platform. > > > > > > > 4) Could you give more detail on this? "We should take every magic > > > constant and turn it into a call on the > > > session." > > > > > > > I explained this one above. > > > > Mike > > > > > > > > > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > > > wrote: > > >> Why not just make the constants be class methods on the session? > Then > > >> you just need to worry about creating the right kind of session and > > >> all of the other calls will magically work. Does that sound sane? > > >> > > >> We should take every magic constant and turn it into a call on the > > >> session. > > >> > > >> Mike > > >> > > >> > > >> > > >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: > > >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. And > > >>> then monkey patched all the calls that use constants. The ENV > > >>> approach doesn't work for Bebo since iI am running Facebook and > Bebo > > >>> and Web in the same app. > > >>> > > >>> I have been thinking that this could be generalized more possibly > > >>> into > > >>> facebooker.yml or some other YAML. I was thinking that the whole > > >>> configuration could be keyed off of the api_key that gets sent with > > >>> the request. That way you could actually run more than one > facebook > > >>> app in the same rails instance. > > >>> > > >>> How does this Ringside Networks work? Do you assign an API KEY? > > >>> > > >>> Thanks, > > >>> > > >>> Dave > > >>> > > >>> > > >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > > >>> > > >>>> Dave, since the URLs will no longer be static are you still using > > >>>> ruby > > >>>> constants to store the URLs? Right now I am grabbing the URL > > >>>> configuration from facebooker.yml and storing them into the ENV > > >>>> constant array at the end of init.rb. > > >>>> > > >>>> But this doesn't work during tests. > > >>>> > > >>>> For example in session_test.rb's setup method, I set the ENV array > > >>>> (like I do in init.rb) right before calling the > > >>>> Facebook::Session.create, but the Facebooker::Session class can't > > >>>> see > > >>>> ENV. I'm assuming there is a better way of handling this. Let me > > >>>> know > > >>>> if any of you have any suggestions. I'll complete the test. > > >>>> > > >>>> These are the constants I am talking about: > > >>>> > > >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > > >>>> "apps.facebook.com" > > >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > > >>>> "api.facebook.com" > > >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ > > >>>> restserver.php" > > >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || " > www.facebook.com > > >>>> " > > >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || "/login.php" > > >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > > >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > > >>>> install.php" > > >>>> > > >>>> Right now that code is in session.rb. It seems the best way to do > > >>>> this > > >>>> is to allow people to set these parameters in the facebooker.yml > > >>>> optionally, and if they are not set then it defaults to Facebook > > >>>> addresses. I just don't know the best way to make the > configuration > > >>>> portable. > > >>>> > > >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > > >>>> wrote: > > >>>>> Can you submit this as a patch, with tests, I have a bebo > > >>>>> adapter that I > > >>>>> have been working on so I can take a look and see if it fits in > > >>>>> with that, > > >>>>> as I have had similar issues. > > >>>>> > > >>>>> Dave > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto < > jonathan.otto at gmail.com > > >>>>>> > > >>>>> wrote: > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> I am requesting that we change the paths that absolutely point > to > > >>>>>> the > > >>>>>> facebook URL. > > >>>>>> > > >>>>>> In the PHP client there is a method in the facebook.php file > > >>>>>> called > > >>>>>> get_facebook_url() so this is easy to change there. > > >>>>>> > > >>>>>> One reason for this: > > >>>>>> > > >>>>>> Ringside Networks is a drop in replacement for Facebook that > > >>>>>> can be > > >>>>>> used for localhost development and eventually an abstraction for > > >>>>>> most > > >>>>>> social networks - it mimics the Facebook API so the Facebooker > > >>>>>> client > > >>>>>> works except for the URLs pointing to the Facebook domain. I > have > > >>>>>> changes ready if Mike Mangino or anyone else is willing to > commit > > >>>>>> them. > > >>>>>> > > >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home > > >>>>>> _______________________________________________ > > >>>>>> 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 > > >> > > >> > > >> > > >> > > > > -- > > Mike Mangino > > http://www.elevatedrails.com > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080401/c6debc28/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: bebo_adapter.rb Type: text/x-ruby-script Size: 4112 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080401/c6debc28/attachment-0001.bin From lpgauth at gmail.com Wed Apr 2 00:04:12 2008 From: lpgauth at gmail.com (Louis-Philippe Gauthier) Date: Wed, 2 Apr 2008 00:04:12 -0400 Subject: [Facebooker-talk] facebooker plugin!? Message-ID: <284c13bc0804012104y3fcbd94k7fff562bab433494@mail.gmail.com> I'm trying to create a facebook application but I have no success. I either get one of those two errors depending on which revision of the plugin I use: CGI::Session::CookieStore::TamperedWithCookie (Using plugin from directory) or ActionView::TemplateError (Session key invalid or no longer valid) (Using plugin from a week ago or so). Has anyone successfully gotten an app that as to be added (ensure_application_is_installed_by_facebook_user) and uses FBML (not iframe) ? I can't get it to work.. I don't know if it's the plugin or me but any input would be great... LP From mmangino at elevatedrails.com Wed Apr 2 09:18:44 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Wed, 2 Apr 2008 08:18:44 -0500 Subject: [Facebooker-talk] facebooker plugin!? In-Reply-To: <284c13bc0804012104y3fcbd94k7fff562bab433494@mail.gmail.com> References: <284c13bc0804012104y3fcbd94k7fff562bab433494@mail.gmail.com> Message-ID: Are you using the cookie session store? If so, don't use that. It won't work with Facebook, since Facebook doesn't support cookies. Mike On Apr 1, 2008, at 11:04 PM, Louis-Philippe Gauthier wrote: > I'm trying to create a facebook application but I have no success. I > either get one of those two errors depending on which revision of the > plugin I use: > > CGI::Session::CookieStore::TamperedWithCookie (Using plugin from > directory) > > or > > ActionView::TemplateError (Session key invalid or no longer valid) > (Using plugin from a week ago or so). > > Has anyone successfully gotten an app that as to be added > (ensure_application_is_installed_by_facebook_user) and uses FBML (not > iframe) ? I can't get it to work.. I don't know if it's the plugin or > me but any input would be great... > > LP > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From jonathan.otto at gmail.com Wed Apr 2 14:10:31 2008 From: jonathan.otto at gmail.com (Jonathan Otto) Date: Wed, 2 Apr 2008 13:10:31 -0500 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: Dave, Mike et al., I like the Bebo adapter, but I was still hoping to have the functionality to change the API paths in the plugin, and allow the adapters to focus on the API methods. I have discovered that this is much harder to do than I thought. The Facebooker plugin is built in a way that will require quite a bit of reconfiguration: The canvas page, and secret key seem to be getting called from either static methods or ENV variables before the session is created, but with my additions it is not until the session is created that the class methods are ready with the correct canvas page and API URLs. Also, the method being used to access the session (Facebooker::Session.current) seems to return the hash instead of the actual Ruby object. Changing this is going to require configuration that I am not sure the commit team is willing to commit. Still, I have attached what code I have added so far. Let me know if you guys want to continue down this path and I'll keep working, but until then I'm just going to hardcode an adapter (as Dave did) with what I need. Jonathan On Tue, Apr 1, 2008 at 4:39 PM, David Clements wrote: > Not sure if I am totally following you. > > In the bebo_adapter I created I overrode the controller method > > > new_facebook_session to create the appropriate session object at the time > the request parameters are processed. After you have the appropriate > Session object then everything should be able to be contained within that > Session object. I don't think you need the params being processed again. > > What I was going to do is make sure the Facebooker::Sesttion.current_session > always hold the correct session. > > Then if you need to access some configuration, like deep in url_rewriting, > you can call Facebooker::Session.current_session.application_base > > Not sure if that helps. > > Here are a couple of other issue that might come up. > > If you are doing any async processing then you will not have an request > parameters to go off of so creating the correct session type should be > enough to encapsulate all the configuration parameters. This is another > reason why may want to process the parameters once and then have everything > else go off the current_session object. > > Hope that helps, I am attaching the bebo_adapter that I have in production > right now in case it helps. There are a lot of other places in bebo that > the API's don't match up so I have to patch different places in the code. > > Dave > > > On Tue, Apr 1, 2008 at 3:24 PM, Jonathan Otto > wrote: > > > I'm close to getting this working in a fairly DRY fashion. First, a > > few questions and some guidance. > > > > Right now I have all the configuration variables loaded from > > facebooker.yml. You can specify 3 different APIs for each RAILS_ENV - > > facebook, bebo, or ringside, but if you specify nothing, it defaults > > to the Facebook configuration. When the plugin is initialized it > > stores the YAML file into the ENV hash. > > > > The plan is that the session object will be created by examining the > > POST parameters on each request and grabbing the correct configuration > > from the ENV hash. Other classes needing the information will call > > @session.apps_url, or @session.www_url etc.. > > > > Before I can continue on this route, I need to access the parameters > > hash. So is there a built in way to access the parameter hash from the > > session class? I could pass it in everywhere > > Facebooker::Session.create, or Session.secret_key, etc.. is called, > > but that would require a few changes in the controller. > > > > This seems optimal because it allows each request to your application > > to respond to requests from Bebo, Facebook, Ringside, or other future > > APIs without reloading the YAML file. > > > > Please provide suggestions, corrections, or guidance. > > > > > > > > > > On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino > wrote: > > > > > > On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > > > > Mike - > > > > > > > > 1) Is the point of making them (the API URLs - currently constants) > > > > class methods so they can be more readily changed - as in after the > > > > plugin is loaded and during program execution? If it is not, I don't > > > > see why my above code wouldn't suffice. > > > > > > > > > > They would change based upon the type of session used. Facebook will > > > not change their API url during execution, so there is no need for > > > that to change during requests. Each different container will have > > > it's own session object. > > > > > > > > > > 2) If you guys plan on letting these URLs change during program > > > > execution, how will you detect what API to set the configuration for? > > > > The POST params might be the same (At least I suspect they are the > > > > same for Bebo and Facebook, Ringside however does have some unique > > > > additions). > > > > > > You need some way to tell what site you are talking to. Facebook and > > > Bebo have different parameters. Bebo uses sn_* where facebook uses > > > fb_*. Each container will need to provide a way of determining if the > > > request is for them. Once a session is active, the stored session will > > > tell you what you need to know. > > > > > > > > > > > > > > > > > > 3) What are magic constants? > > > > > > > > > > By magic constants, I mean strings in the API. For instance some > > > methods cal session.post on "facebook.users.user_getInfo", that is a > > > magic constant. Instead, it should be session.post(:user_get_info) or > > > something similar. Then, the user can look up what API key it needs to > > > use for that platform. > > > > > > > > > > 4) Could you give more detail on this? "We should take every magic > > > > constant and turn it into a call on the > > > > session." > > > > > > > > > > I explained this one above. > > > > > > Mike > > > > > > > > > > > > > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > > > > wrote: > > > >> Why not just make the constants be class methods on the session? > Then > > > >> you just need to worry about creating the right kind of session and > > > >> all of the other calls will magically work. Does that sound sane? > > > >> > > > >> We should take every magic constant and turn it into a call on the > > > >> session. > > > >> > > > >> Mike > > > >> > > > >> > > > >> > > > >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: > > > >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. And > > > >>> then monkey patched all the calls that use constants. The ENV > > > >>> approach doesn't work for Bebo since iI am running Facebook and > Bebo > > > >>> and Web in the same app. > > > >>> > > > >>> I have been thinking that this could be generalized more possibly > > > >>> into > > > >>> facebooker.yml or some other YAML. I was thinking that the whole > > > >>> configuration could be keyed off of the api_key that gets sent with > > > >>> the request. That way you could actually run more than one > facebook > > > >>> app in the same rails instance. > > > >>> > > > >>> How does this Ringside Networks work? Do you assign an API KEY? > > > >>> > > > >>> Thanks, > > > >>> > > > >>> Dave > > > >>> > > > >>> > > > >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > > > >>> > > > >>>> Dave, since the URLs will no longer be static are you still using > > > >>>> ruby > > > >>>> constants to store the URLs? Right now I am grabbing the URL > > > >>>> configuration from facebooker.yml and storing them into the ENV > > > >>>> constant array at the end of init.rb. > > > >>>> > > > >>>> But this doesn't work during tests. > > > >>>> > > > >>>> For example in session_test.rb's setup method, I set the ENV array > > > >>>> (like I do in init.rb) right before calling the > > > >>>> Facebook::Session.create, but the Facebooker::Session class can't > > > >>>> see > > > >>>> ENV. I'm assuming there is a better way of handling this. Let me > > > >>>> know > > > >>>> if any of you have any suggestions. I'll complete the test. > > > >>>> > > > >>>> These are the constants I am talking about: > > > >>>> > > > >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > > > >>>> "apps.facebook.com" > > > >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > > > >>>> "api.facebook.com" > > > >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ > > > >>>> restserver.php" > > > >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || > "www.facebook.com > > > >>>> " > > > >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || "/login.php" > > > >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > > > >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > > > >>>> install.php" > > > >>>> > > > >>>> Right now that code is in session.rb. It seems the best way to do > > > >>>> this > > > >>>> is to allow people to set these parameters in the facebooker.yml > > > >>>> optionally, and if they are not set then it defaults to Facebook > > > >>>> addresses. I just don't know the best way to make the > configuration > > > >>>> portable. > > > >>>> > > > >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > > > >>>> wrote: > > > >>>>> Can you submit this as a patch, with tests, I have a bebo > > > >>>>> adapter that I > > > >>>>> have been working on so I can take a look and see if it fits in > > > >>>>> with that, > > > >>>>> as I have had similar issues. > > > >>>>> > > > >>>>> Dave > > > >>>>> > > > >>>>> > > > >>>>> > > > >>>>> > > > >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto > > > >>>>>> > > > >>>>> wrote: > > > >>>>>> > > > >>>>>> > > > >>>>>> > > > >>>>>> I am requesting that we change the paths that absolutely point > to > > > >>>>>> the > > > >>>>>> facebook URL. > > > >>>>>> > > > >>>>>> In the PHP client there is a method in the facebook.php file > > > >>>>>> called > > > >>>>>> get_facebook_url() so this is easy to change there. > > > >>>>>> > > > >>>>>> One reason for this: > > > >>>>>> > > > >>>>>> Ringside Networks is a drop in replacement for Facebook that > > > >>>>>> can be > > > >>>>>> used for localhost development and eventually an abstraction for > > > >>>>>> most > > > >>>>>> social networks - it mimics the Facebook API so the Facebooker > > > >>>>>> client > > > >>>>>> works except for the URLs pointing to the Facebook domain. I > have > > > >>>>>> changes ready if Mike Mangino or anyone else is willing to > commit > > > >>>>>> them. > > > >>>>>> > > > >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home > > > >>>>>> _______________________________________________ > > > >>>>>> 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 > > > >> > > > >> > > > >> > > > >> > > > > > > -- > > > Mike Mangino > > > http://www.elevatedrails.com > > > > > > > > > > > > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: facebooker_patch.rb Type: text/x-ruby-script Size: 5839 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080402/368725ca/attachment.bin From digidigo at gmail.com Wed Apr 2 14:39:24 2008 From: digidigo at gmail.com (David Clements) Date: Wed, 2 Apr 2008 12:39:24 -0600 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: Yeah, The bebo adapter is a work in progress. A big hack actually to get things in production for travelerstable.com. I was about to split the repo and start implementing it in a much cleaner way. I'll put that back on my list of things todo and see if we can't get a more extensible architecture in place. Dave On Wed, Apr 2, 2008 at 12:10 PM, Jonathan Otto wrote: > Dave, Mike et al., > > I like the Bebo adapter, but I was still hoping to have the > functionality to change the API paths in the plugin, and allow the > adapters to focus on the API methods. > > I have discovered that this is much harder to do than I thought. The > Facebooker plugin is built in a way that will require quite a bit of > reconfiguration: > > The canvas page, and secret key seem to be getting called from either > static methods or ENV variables before the session is created, but > with my additions it is not until the session is created that the > class methods are ready with the correct canvas page and API URLs. > Also, the method being used to access the session > (Facebooker::Session.current) seems to return the hash instead of the > actual Ruby object. > > Changing this is going to require configuration that I am not sure the > commit team is willing to commit. Still, I have attached what code I > have added so far. Let me know if you guys want to continue down this > path and I'll keep working, but until then I'm just going to hardcode > an adapter (as Dave did) with what I need. > > Jonathan > > On Tue, Apr 1, 2008 at 4:39 PM, David Clements wrote: > > Not sure if I am totally following you. > > > > In the bebo_adapter I created I overrode the controller method > > > > > > new_facebook_session to create the appropriate session object at the > time > > the request parameters are processed. After you have the appropriate > > Session object then everything should be able to be contained within > that > > Session object. I don't think you need the params being processed > again. > > > > What I was going to do is make sure the > Facebooker::Sesttion.current_session > > always hold the correct session. > > > > Then if you need to access some configuration, like deep in > url_rewriting, > > you can call Facebooker::Session.current_session.application_base > > > > Not sure if that helps. > > > > Here are a couple of other issue that might come up. > > > > If you are doing any async processing then you will not have an request > > parameters to go off of so creating the correct session type should be > > enough to encapsulate all the configuration parameters. This is another > > reason why may want to process the parameters once and then have > everything > > else go off the current_session object. > > > > Hope that helps, I am attaching the bebo_adapter that I have in > production > > right now in case it helps. There are a lot of other places in bebo > that > > the API's don't match up so I have to patch different places in the > code. > > > > Dave > > > > > > On Tue, Apr 1, 2008 at 3:24 PM, Jonathan Otto > > wrote: > > > > > I'm close to getting this working in a fairly DRY fashion. First, a > > > few questions and some guidance. > > > > > > Right now I have all the configuration variables loaded from > > > facebooker.yml. You can specify 3 different APIs for each RAILS_ENV - > > > facebook, bebo, or ringside, but if you specify nothing, it defaults > > > to the Facebook configuration. When the plugin is initialized it > > > stores the YAML file into the ENV hash. > > > > > > The plan is that the session object will be created by examining the > > > POST parameters on each request and grabbing the correct configuration > > > from the ENV hash. Other classes needing the information will call > > > @session.apps_url, or @session.www_url etc.. > > > > > > Before I can continue on this route, I need to access the parameters > > > hash. So is there a built in way to access the parameter hash from the > > > session class? I could pass it in everywhere > > > Facebooker::Session.create, or Session.secret_key, etc.. is called, > > > but that would require a few changes in the controller. > > > > > > This seems optimal because it allows each request to your application > > > to respond to requests from Bebo, Facebook, Ringside, or other future > > > APIs without reloading the YAML file. > > > > > > Please provide suggestions, corrections, or guidance. > > > > > > > > > > > > > > > On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino < > mmangino at elevatedrails.com> > > wrote: > > > > > > > > On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > > > > > Mike - > > > > > > > > > > 1) Is the point of making them (the API URLs - currently > constants) > > > > > class methods so they can be more readily changed - as in after > the > > > > > plugin is loaded and during program execution? If it is not, I > don't > > > > > see why my above code wouldn't suffice. > > > > > > > > > > > > > They would change based upon the type of session used. Facebook > will > > > > not change their API url during execution, so there is no need for > > > > that to change during requests. Each different container will have > > > > it's own session object. > > > > > > > > > > > > > 2) If you guys plan on letting these URLs change during program > > > > > execution, how will you detect what API to set the configuration > for? > > > > > The POST params might be the same (At least I suspect they are > the > > > > > same for Bebo and Facebook, Ringside however does have some > unique > > > > > additions). > > > > > > > > You need some way to tell what site you are talking to. Facebook > and > > > > Bebo have different parameters. Bebo uses sn_* where facebook uses > > > > fb_*. Each container will need to provide a way of determining if > the > > > > request is for them. Once a session is active, the stored session > will > > > > tell you what you need to know. > > > > > > > > > > > > > > > > > > > > > > > 3) What are magic constants? > > > > > > > > > > > > > By magic constants, I mean strings in the API. For instance some > > > > methods cal session.post on "facebook.users.user_getInfo", that is > a > > > > magic constant. Instead, it should be session.post(:user_get_info) > or > > > > something similar. Then, the user can look up what API key it needs > to > > > > use for that platform. > > > > > > > > > > > > > 4) Could you give more detail on this? "We should take every > magic > > > > > constant and turn it into a call on the > > > > > session." > > > > > > > > > > > > > I explained this one above. > > > > > > > > Mike > > > > > > > > > > > > > > > > > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > > > > > wrote: > > > > >> Why not just make the constants be class methods on the session? > > Then > > > > >> you just need to worry about creating the right kind of session > and > > > > >> all of the other calls will magically work. Does that sound > sane? > > > > >> > > > > >> We should take every magic constant and turn it into a call on > the > > > > >> session. > > > > >> > > > > >> Mike > > > > >> > > > > >> > > > > >> > > > > >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: > > > > >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. > And > > > > >>> then monkey patched all the calls that use constants. The ENV > > > > >>> approach doesn't work for Bebo since iI am running Facebook and > > Bebo > > > > >>> and Web in the same app. > > > > >>> > > > > >>> I have been thinking that this could be generalized more > possibly > > > > >>> into > > > > >>> facebooker.yml or some other YAML. I was thinking that the > whole > > > > >>> configuration could be keyed off of the api_key that gets sent > with > > > > >>> the request. That way you could actually run more than one > > facebook > > > > >>> app in the same rails instance. > > > > >>> > > > > >>> How does this Ringside Networks work? Do you assign an API > KEY? > > > > >>> > > > > >>> Thanks, > > > > >>> > > > > >>> Dave > > > > >>> > > > > >>> > > > > >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > > > > >>> > > > > >>>> Dave, since the URLs will no longer be static are you still > using > > > > >>>> ruby > > > > >>>> constants to store the URLs? Right now I am grabbing the URL > > > > >>>> configuration from facebooker.yml and storing them into the > ENV > > > > >>>> constant array at the end of init.rb. > > > > >>>> > > > > >>>> But this doesn't work during tests. > > > > >>>> > > > > >>>> For example in session_test.rb's setup method, I set the ENV > array > > > > >>>> (like I do in init.rb) right before calling the > > > > >>>> Facebook::Session.create, but the Facebooker::Session class > can't > > > > >>>> see > > > > >>>> ENV. I'm assuming there is a better way of handling this. Let > me > > > > >>>> know > > > > >>>> if any of you have any suggestions. I'll complete the test. > > > > >>>> > > > > >>>> These are the constants I am talking about: > > > > >>>> > > > > >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > > > > >>>> "apps.facebook.com" > > > > >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > > > > >>>> "api.facebook.com" > > > > >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ > > > > >>>> restserver.php" > > > > >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || > > "www.facebook.com > > > > >>>> " > > > > >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || > "/login.php" > > > > >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > > > > >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > > > > >>>> install.php" > > > > >>>> > > > > >>>> Right now that code is in session.rb. It seems the best way to > do > > > > >>>> this > > > > >>>> is to allow people to set these parameters in the > facebooker.yml > > > > >>>> optionally, and if they are not set then it defaults to > Facebook > > > > >>>> addresses. I just don't know the best way to make the > > configuration > > > > >>>> portable. > > > > >>>> > > > > >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > > > > >>>> wrote: > > > > >>>>> Can you submit this as a patch, with tests, I have a bebo > > > > >>>>> adapter that I > > > > >>>>> have been working on so I can take a look and see if it fits > in > > > > >>>>> with that, > > > > >>>>> as I have had similar issues. > > > > >>>>> > > > > >>>>> Dave > > > > >>>>> > > > > >>>>> > > > > >>>>> > > > > >>>>> > > > > >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto > > > > > >>>>>> > > > > >>>>> wrote: > > > > >>>>>> > > > > >>>>>> > > > > >>>>>> > > > > >>>>>> I am requesting that we change the paths that absolutely > point > > to > > > > >>>>>> the > > > > >>>>>> facebook URL. > > > > >>>>>> > > > > >>>>>> In the PHP client there is a method in the facebook.php file > > > > >>>>>> called > > > > >>>>>> get_facebook_url() so this is easy to change there. > > > > >>>>>> > > > > >>>>>> One reason for this: > > > > >>>>>> > > > > >>>>>> Ringside Networks is a drop in replacement for Facebook that > > > > >>>>>> can be > > > > >>>>>> used for localhost development and eventually an abstraction > for > > > > >>>>>> most > > > > >>>>>> social networks - it mimics the Facebook API so the > Facebooker > > > > >>>>>> client > > > > >>>>>> works except for the URLs pointing to the Facebook domain. I > > have > > > > >>>>>> changes ready if Mike Mangino or anyone else is willing to > > commit > > > > >>>>>> them. > > > > >>>>>> > > > > >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home > > > > >>>>>> _______________________________________________ > > > > >>>>>> 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 > > > > >> > > > > >> > > > > >> > > > > >> > > > > > > > > -- > > > > Mike Mangino > > > > http://www.elevatedrails.com > > > > > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080402/03e0c9c1/attachment-0001.html From jonathan.otto at gmail.com Wed Apr 2 17:49:14 2008 From: jonathan.otto at gmail.com (Jonathan Otto) Date: Wed, 2 Apr 2008 16:49:14 -0500 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: Dave, thanks for this Bebo adapter, I am modifying it for Ringside. If you don't mind are there any special instructions to use it? I required it at the end of init.rb but I am having a problem with incorrect signature during the controller's verify_signature method. Specifically I am getting an incorrect signature (although I do have have the ringside_api_key and ringside_secret_key in the facebooker.yml) Is there anything else to do besides requiring this file? I noticed during a debugger session that while in the verify_signature method, it was using the api_key and secret_key instead of the ringside keys, perhaps it is not loading them correctly before the session is created. I apologize for asking for help with your adapter, I do greatly appreciate your work. Feel free to ignore. I will complete the rest of the adapter and put it up for public consumption in case anyone is interesting in playing with Ringside. Jonathan On Wed, Apr 2, 2008 at 1:39 PM, David Clements wrote: > Yeah, > > The bebo adapter is a work in progress. A big hack actually to get things > in production for travelerstable.com. I was about to split the repo and > start implementing it in a much cleaner way. I'll put that back on my list > of things todo and see if we can't get a more extensible architecture in > place. > > Dave > > > > > On Wed, Apr 2, 2008 at 12:10 PM, Jonathan Otto > wrote: > > > Dave, Mike et al., > > > > I like the Bebo adapter, but I was still hoping to have the > > functionality to change the API paths in the plugin, and allow the > > adapters to focus on the API methods. > > > > I have discovered that this is much harder to do than I thought. The > > Facebooker plugin is built in a way that will require quite a bit of > > reconfiguration: > > > > The canvas page, and secret key seem to be getting called from either > > static methods or ENV variables before the session is created, but > > with my additions it is not until the session is created that the > > class methods are ready with the correct canvas page and API URLs. > > Also, the method being used to access the session > > (Facebooker::Session.current) seems to return the hash instead of the > > actual Ruby object. > > > > Changing this is going to require configuration that I am not sure the > > commit team is willing to commit. Still, I have attached what code I > > have added so far. Let me know if you guys want to continue down this > > path and I'll keep working, but until then I'm just going to hardcode > > an adapter (as Dave did) with what I need. > > > > Jonathan > > > > > > > > > > On Tue, Apr 1, 2008 at 4:39 PM, David Clements wrote: > > > Not sure if I am totally following you. > > > > > > In the bebo_adapter I created I overrode the controller method > > > > > > > > > new_facebook_session to create the appropriate session object at the > time > > > the request parameters are processed. After you have the appropriate > > > Session object then everything should be able to be contained within > that > > > Session object. I don't think you need the params being processed > again. > > > > > > What I was going to do is make sure the > Facebooker::Sesttion.current_session > > > always hold the correct session. > > > > > > Then if you need to access some configuration, like deep in > url_rewriting, > > > you can call Facebooker::Session.current_session.application_base > > > > > > Not sure if that helps. > > > > > > Here are a couple of other issue that might come up. > > > > > > If you are doing any async processing then you will not have an request > > > parameters to go off of so creating the correct session type should be > > > enough to encapsulate all the configuration parameters. This is another > > > reason why may want to process the parameters once and then have > everything > > > else go off the current_session object. > > > > > > Hope that helps, I am attaching the bebo_adapter that I have in > production > > > right now in case it helps. There are a lot of other places in bebo > that > > > the API's don't match up so I have to patch different places in the > code. > > > > > > Dave > > > > > > > > > On Tue, Apr 1, 2008 at 3:24 PM, Jonathan Otto > > > wrote: > > > > > > > I'm close to getting this working in a fairly DRY fashion. First, a > > > > few questions and some guidance. > > > > > > > > Right now I have all the configuration variables loaded from > > > > facebooker.yml. You can specify 3 different APIs for each RAILS_ENV - > > > > facebook, bebo, or ringside, but if you specify nothing, it defaults > > > > to the Facebook configuration. When the plugin is initialized it > > > > stores the YAML file into the ENV hash. > > > > > > > > The plan is that the session object will be created by examining the > > > > POST parameters on each request and grabbing the correct configuration > > > > from the ENV hash. Other classes needing the information will call > > > > @session.apps_url, or @session.www_url etc.. > > > > > > > > Before I can continue on this route, I need to access the parameters > > > > hash. So is there a built in way to access the parameter hash from the > > > > session class? I could pass it in everywhere > > > > Facebooker::Session.create, or Session.secret_key, etc.. is called, > > > > but that would require a few changes in the controller. > > > > > > > > This seems optimal because it allows each request to your application > > > > to respond to requests from Bebo, Facebook, Ringside, or other future > > > > APIs without reloading the YAML file. > > > > > > > > Please provide suggestions, corrections, or guidance. > > > > > > > > > > > > > > > > > > > > On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino > > > > wrote: > > > > > > > > > > On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: > > > > > > Mike - > > > > > > > > > > > > 1) Is the point of making them (the API URLs - currently > constants) > > > > > > class methods so they can be more readily changed - as in after > the > > > > > > plugin is loaded and during program execution? If it is not, I > don't > > > > > > see why my above code wouldn't suffice. > > > > > > > > > > > > > > > > They would change based upon the type of session used. Facebook > will > > > > > not change their API url during execution, so there is no need for > > > > > that to change during requests. Each different container will have > > > > > it's own session object. > > > > > > > > > > > > > > > > 2) If you guys plan on letting these URLs change during program > > > > > > execution, how will you detect what API to set the configuration > for? > > > > > > The POST params might be the same (At least I suspect they are > the > > > > > > same for Bebo and Facebook, Ringside however does have some > unique > > > > > > additions). > > > > > > > > > > You need some way to tell what site you are talking to. Facebook > and > > > > > Bebo have different parameters. Bebo uses sn_* where facebook uses > > > > > fb_*. Each container will need to provide a way of determining if > the > > > > > request is for them. Once a session is active, the stored session > will > > > > > tell you what you need to know. > > > > > > > > > > > > > > > > > > > > > > > > > > > > 3) What are magic constants? > > > > > > > > > > > > > > > > By magic constants, I mean strings in the API. For instance some > > > > > methods cal session.post on "facebook.users.user_getInfo", that is > a > > > > > magic constant. Instead, it should be session.post(:user_get_info) > or > > > > > something similar. Then, the user can look up what API key it needs > to > > > > > use for that platform. > > > > > > > > > > > > > > > > 4) Could you give more detail on this? "We should take every > magic > > > > > > constant and turn it into a call on the > > > > > > session." > > > > > > > > > > > > > > > > I explained this one above. > > > > > > > > > > Mike > > > > > > > > > > > > > > > > > > > > > On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino > > > > > > wrote: > > > > > >> Why not just make the constants be class methods on the session? > > > Then > > > > > >> you just need to worry about creating the right kind of session > and > > > > > >> all of the other calls will magically work. Does that sound > sane? > > > > > >> > > > > > >> We should take every magic constant and turn it into a call on > the > > > > > >> session. > > > > > >> > > > > > >> Mike > > > > > >> > > > > > >> > > > > > >> > > > > > >> On Mar 31, 2008, at 5:57 PM, David Clements wrote: > > > > > >>> For Bebo, I subclassed Facebooker::Session into a BeboSession. > And > > > > > >>> then monkey patched all the calls that use constants. The ENV > > > > > >>> approach doesn't work for Bebo since iI am running Facebook and > > > Bebo > > > > > >>> and Web in the same app. > > > > > >>> > > > > > >>> I have been thinking that this could be generalized more > possibly > > > > > >>> into > > > > > >>> facebooker.yml or some other YAML. I was thinking that the > whole > > > > > >>> configuration could be keyed off of the api_key that gets sent > with > > > > > >>> the request. That way you could actually run more than one > > > facebook > > > > > >>> app in the same rails instance. > > > > > >>> > > > > > >>> How does this Ringside Networks work? Do you assign an API > KEY? > > > > > >>> > > > > > >>> Thanks, > > > > > >>> > > > > > >>> Dave > > > > > >>> > > > > > >>> > > > > > >>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: > > > > > >>> > > > > > >>>> Dave, since the URLs will no longer be static are you still > using > > > > > >>>> ruby > > > > > >>>> constants to store the URLs? Right now I am grabbing the URL > > > > > >>>> configuration from facebooker.yml and storing them into the > ENV > > > > > >>>> constant array at the end of init.rb. > > > > > >>>> > > > > > >>>> But this doesn't work during tests. > > > > > >>>> > > > > > >>>> For example in session_test.rb's setup method, I set the ENV > array > > > > > >>>> (like I do in init.rb) right before calling the > > > > > >>>> Facebook::Session.create, but the Facebooker::Session class > can't > > > > > >>>> see > > > > > >>>> ENV. I'm assuming there is a better way of handling this. Let > me > > > > > >>>> know > > > > > >>>> if any of you have any suggestions. I'll complete the test. > > > > > >>>> > > > > > >>>> These are the constants I am talking about: > > > > > >>>> > > > > > >>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || > > > > > >>>> "apps.facebook.com" > > > > > >>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || > > > > > >>>> "api.facebook.com" > > > > > >>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ > > > > > >>>> restserver.php" > > > > > >>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || > > > "www.facebook.com > > > > > >>>> " > > > > > >>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || > "/login.php" > > > > > >>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" > > > > > >>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ > > > > > >>>> install.php" > > > > > >>>> > > > > > >>>> Right now that code is in session.rb. It seems the best way to > do > > > > > >>>> this > > > > > >>>> is to allow people to set these parameters in the > facebooker.yml > > > > > >>>> optionally, and if they are not set then it defaults to > Facebook > > > > > >>>> addresses. I just don't know the best way to make the > > > configuration > > > > > >>>> portable. > > > > > >>>> > > > > > >>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements > > > > > >>>> wrote: > > > > > >>>>> Can you submit this as a patch, with tests, I have a bebo > > > > > >>>>> adapter that I > > > > > >>>>> have been working on so I can take a look and see if it fits > in > > > > > >>>>> with that, > > > > > >>>>> as I have had similar issues. > > > > > >>>>> > > > > > >>>>> Dave > > > > > >>>>> > > > > > >>>>> > > > > > >>>>> > > > > > >>>>> > > > > > >>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto > > > > > > > >>>>>> > > > > > >>>>> wrote: > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>>>> I am requesting that we change the paths that absolutely > point > > > to > > > > > >>>>>> the > > > > > >>>>>> facebook URL. > > > > > >>>>>> > > > > > >>>>>> In the PHP client there is a method in the facebook.php file > > > > > >>>>>> called > > > > > >>>>>> get_facebook_url() so this is easy to change there. > > > > > >>>>>> > > > > > >>>>>> One reason for this: > > > > > >>>>>> > > > > > >>>>>> Ringside Networks is a drop in replacement for Facebook that > > > > > >>>>>> can be > > > > > >>>>>> used for localhost development and eventually an abstraction > for > > > > > >>>>>> most > > > > > >>>>>> social networks - it mimics the Facebook API so the > Facebooker > > > > > >>>>>> client > > > > > >>>>>> works except for the URLs pointing to the Facebook domain. I > > > have > > > > > >>>>>> changes ready if Mike Mangino or anyone else is willing to > > > commit > > > > > >>>>>> them. > > > > > >>>>>> > > > > > >>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home > > > > > >>>>>> _______________________________________________ > > > > > >>>>>> 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 > > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > > > > > > -- > > > > > Mike Mangino > > > > > http://www.elevatedrails.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From david.g.clements at gmail.com Wed Apr 2 17:54:58 2008 From: david.g.clements at gmail.com (David Clements) Date: Wed, 2 Apr 2008 15:54:58 -0600 Subject: [Facebooker-talk] request for change in URL pointing to facebook domain In-Reply-To: References: <78833CF6-8F78-4EC0-BDC2-E960264A9C44@gmail.com> <90B82FDD-61B9-40F6-9B9A-80921FB714BA@elevatedrails.com> <1AC75647-7FD4-4B5B-85F1-66D0AD5B4115@elevatedrails.com> Message-ID: Hey Johnathan, It hasn't been cleaned up . I think one piece that is missing is where I setup the session... I think that is in my application.rb Here is some code from my application.rb ############ BEBO OVERIDE STUFF # # Overide the session create so that we can override the above methods # This won't be necessary if we abstract install url api server url , api path rest def new_facebook_session if(Facebooker::Session.bebo_request) Facebooker::BeboSession.create(Facebooker::BeboSession.api_key, Facebooker::BeboSession.secret_key) else Facebooker::Session.create(Facebooker::Session.api_key, Facebooker::Session.secret_key) end end # Setup bebo context. Itried a prepend before filter here but it didn't work. def set_facebook_session set_application_context super end # Expose from the class level contenxt whether we are in a bebo request or not. def set_application_context Facebooker::Session.bebo_request = params[:fb_sig_network] == 'Bebo' end Like I said I am going to try and clean this up but for now you are on your own to try and piece it together. Feel free to ask me anything. Dave On Apr 2, 2008, at 3:49 PM, Jonathan Otto wrote: > Dave, thanks for this Bebo adapter, I am modifying it for Ringside. If > you don't mind are there any special instructions to use it? > > I required it at the end of init.rb but I am having a problem with > incorrect signature during the controller's verify_signature method. > > Specifically I am getting an incorrect signature (although I do have > have the ringside_api_key and ringside_secret_key in the > facebooker.yml) > > Is there anything else to do besides requiring this file? I noticed > during a debugger session that while in the verify_signature method, > it was using the api_key and secret_key instead of the ringside keys, > perhaps it is not loading them correctly before the session is > created. > > I apologize for asking for help with your adapter, I do greatly > appreciate your work. Feel free to ignore. > > I will complete the rest of the adapter and put it up for public > consumption in case anyone is interesting in playing with Ringside. > > Jonathan > > On Wed, Apr 2, 2008 at 1:39 PM, David Clements > wrote: >> Yeah, >> >> The bebo adapter is a work in progress. A big hack actually to get >> things >> in production for travelerstable.com. I was about to split the >> repo and >> start implementing it in a much cleaner way. I'll put that back on >> my list >> of things todo and see if we can't get a more extensible >> architecture in >> place. >> >> Dave >> >> >> >> >> On Wed, Apr 2, 2008 at 12:10 PM, Jonathan Otto > > >> wrote: >> >>> Dave, Mike et al., >>> >>> I like the Bebo adapter, but I was still hoping to have the >>> functionality to change the API paths in the plugin, and allow the >>> adapters to focus on the API methods. >>> >>> I have discovered that this is much harder to do than I thought. The >>> Facebooker plugin is built in a way that will require quite a bit of >>> reconfiguration: >>> >>> The canvas page, and secret key seem to be getting called from >>> either >>> static methods or ENV variables before the session is created, but >>> with my additions it is not until the session is created that the >>> class methods are ready with the correct canvas page and API URLs. >>> Also, the method being used to access the session >>> (Facebooker::Session.current) seems to return the hash instead of >>> the >>> actual Ruby object. >>> >>> Changing this is going to require configuration that I am not sure >>> the >>> commit team is willing to commit. Still, I have attached what code I >>> have added so far. Let me know if you guys want to continue down >>> this >>> path and I'll keep working, but until then I'm just going to >>> hardcode >>> an adapter (as Dave did) with what I need. >>> >>> Jonathan >>> >>> >>> >>> >>> On Tue, Apr 1, 2008 at 4:39 PM, David Clements >>> wrote: >>>> Not sure if I am totally following you. >>>> >>>> In the bebo_adapter I created I overrode the controller method >>>> >>>> >>>> new_facebook_session to create the appropriate session object at >>>> the >> time >>>> the request parameters are processed. After you have the >>>> appropriate >>>> Session object then everything should be able to be contained >>>> within >> that >>>> Session object. I don't think you need the params being processed >> again. >>>> >>>> What I was going to do is make sure the >> Facebooker::Sesttion.current_session >>>> always hold the correct session. >>>> >>>> Then if you need to access some configuration, like deep in >> url_rewriting, >>>> you can call Facebooker::Session.current_session.application_base >>>> >>>> Not sure if that helps. >>>> >>>> Here are a couple of other issue that might come up. >>>> >>>> If you are doing any async processing then you will not have an >>>> request >>>> parameters to go off of so creating the correct session type >>>> should be >>>> enough to encapsulate all the configuration parameters. This is >>>> another >>>> reason why may want to process the parameters once and then have >> everything >>>> else go off the current_session object. >>>> >>>> Hope that helps, I am attaching the bebo_adapter that I have in >> production >>>> right now in case it helps. There are a lot of other places in >>>> bebo >> that >>>> the API's don't match up so I have to patch different places in the >> code. >>>> >>>> Dave >>>> >>>> >>>> On Tue, Apr 1, 2008 at 3:24 PM, Jonathan Otto >>> > >>>> wrote: >>>> >>>>> I'm close to getting this working in a fairly DRY fashion. >>>>> First, a >>>>> few questions and some guidance. >>>>> >>>>> Right now I have all the configuration variables loaded from >>>>> facebooker.yml. You can specify 3 different APIs for each >>>>> RAILS_ENV - >>>>> facebook, bebo, or ringside, but if you specify nothing, it >>>>> defaults >>>>> to the Facebook configuration. When the plugin is initialized it >>>>> stores the YAML file into the ENV hash. >>>>> >>>>> The plan is that the session object will be created by examining >>>>> the >>>>> POST parameters on each request and grabbing the correct >>>>> configuration >>>>> from the ENV hash. Other classes needing the information will call >>>>> @session.apps_url, or @session.www_url etc.. >>>>> >>>>> Before I can continue on this route, I need to access the >>>>> parameters >>>>> hash. So is there a built in way to access the parameter hash >>>>> from the >>>>> session class? I could pass it in everywhere >>>>> Facebooker::Session.create, or Session.secret_key, etc.. is >>>>> called, >>>>> but that would require a few changes in the controller. >>>>> >>>>> This seems optimal because it allows each request to your >>>>> application >>>>> to respond to requests from Bebo, Facebook, Ringside, or other >>>>> future >>>>> APIs without reloading the YAML file. >>>>> >>>>> Please provide suggestions, corrections, or guidance. >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Apr 1, 2008 at 8:23 AM, Mike Mangino >> >>>> wrote: >>>>>> >>>>>> On Apr 1, 2008, at 1:58 AM, Jonathan Otto wrote: >>>>>>> Mike - >>>>>>> >>>>>>> 1) Is the point of making them (the API URLs - currently >> constants) >>>>>>> class methods so they can be more readily changed - as in after >> the >>>>>>> plugin is loaded and during program execution? If it is not, I >> don't >>>>>>> see why my above code wouldn't suffice. >>>>>>> >>>>>> >>>>>> They would change based upon the type of session used. Facebook >> will >>>>>> not change their API url during execution, so there is no need >>>>>> for >>>>>> that to change during requests. Each different container will >>>>>> have >>>>>> it's own session object. >>>>>> >>>>>> >>>>>>> 2) If you guys plan on letting these URLs change during program >>>>>>> execution, how will you detect what API to set the configuration >> for? >>>>>>> The POST params might be the same (At least I suspect they are >> the >>>>>>> same for Bebo and Facebook, Ringside however does have some >> unique >>>>>>> additions). >>>>>> >>>>>> You need some way to tell what site you are talking to. Facebook >> and >>>>>> Bebo have different parameters. Bebo uses sn_* where facebook >>>>>> uses >>>>>> fb_*. Each container will need to provide a way of determining if >> the >>>>>> request is for them. Once a session is active, the stored session >> will >>>>>> tell you what you need to know. >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>> 3) What are magic constants? >>>>>>> >>>>>> >>>>>> By magic constants, I mean strings in the API. For instance some >>>>>> methods cal session.post on "facebook.users.user_getInfo", that >>>>>> is >> a >>>>>> magic constant. Instead, it should be >>>>>> session.post(:user_get_info) >> or >>>>>> something similar. Then, the user can look up what API key it >>>>>> needs >> to >>>>>> use for that platform. >>>>>> >>>>>> >>>>>>> 4) Could you give more detail on this? "We should take every >> magic >>>>>>> constant and turn it into a call on the >>>>>>> session." >>>>>>> >>>>>> >>>>>> I explained this one above. >>>>>> >>>>>> Mike >>>>>> >>>>>> >>>>>> >>>>>>> On Mon, Mar 31, 2008 at 7:02 PM, Mike Mangino >>>>>>> wrote: >>>>>>>> Why not just make the constants be class methods on the >>>>>>>> session? >>>> Then >>>>>>>> you just need to worry about creating the right kind of session >> and >>>>>>>> all of the other calls will magically work. Does that sound >> sane? >>>>>>>> >>>>>>>> We should take every magic constant and turn it into a call on >> the >>>>>>>> session. >>>>>>>> >>>>>>>> Mike >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Mar 31, 2008, at 5:57 PM, David Clements wrote: >>>>>>>>> For Bebo, I subclassed Facebooker::Session into a BeboSession. >> And >>>>>>>>> then monkey patched all the calls that use constants. The ENV >>>>>>>>> approach doesn't work for Bebo since iI am running Facebook >>>>>>>>> and >>>> Bebo >>>>>>>>> and Web in the same app. >>>>>>>>> >>>>>>>>> I have been thinking that this could be generalized more >> possibly >>>>>>>>> into >>>>>>>>> facebooker.yml or some other YAML. I was thinking that the >> whole >>>>>>>>> configuration could be keyed off of the api_key that gets sent >> with >>>>>>>>> the request. That way you could actually run more than one >>>> facebook >>>>>>>>> app in the same rails instance. >>>>>>>>> >>>>>>>>> How does this Ringside Networks work? Do you assign an API >> KEY? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Dave >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mar 31, 2008, at 2:53 PM, Jonathan Otto wrote: >>>>>>>>> >>>>>>>>>> Dave, since the URLs will no longer be static are you still >> using >>>>>>>>>> ruby >>>>>>>>>> constants to store the URLs? Right now I am grabbing the URL >>>>>>>>>> configuration from facebooker.yml and storing them into the >> ENV >>>>>>>>>> constant array at the end of init.rb. >>>>>>>>>> >>>>>>>>>> But this doesn't work during tests. >>>>>>>>>> >>>>>>>>>> For example in session_test.rb's setup method, I set the ENV >> array >>>>>>>>>> (like I do in init.rb) right before calling the >>>>>>>>>> Facebook::Session.create, but the Facebooker::Session class >> can't >>>>>>>>>> see >>>>>>>>>> ENV. I'm assuming there is a better way of handling this. Let >> me >>>>>>>>>> know >>>>>>>>>> if any of you have any suggestions. I'll complete the test. >>>>>>>>>> >>>>>>>>>> These are the constants I am talking about: >>>>>>>>>> >>>>>>>>>> APPS_SERVER_BASE_URL = ENV['APPS_SERVER_BASE_URL'] || >>>>>>>>>> "apps.facebook.com" >>>>>>>>>> API_SERVER_BASE_URL = ENV['API_SERVER_BASE_URL'] || >>>>>>>>>> "api.facebook.com" >>>>>>>>>> API_PATH_REST = ENV['API_PATH_REST'] || "/ >>>>>>>>>> restserver.php" >>>>>>>>>> WWW_SERVER_BASE_URL = ENV['WWW_SERVER_BASE_URL'] || >>>> "www.facebook.com >>>>>>>>>> " >>>>>>>>>> WWW_PATH_LOGIN = ENV['WWW_PATH_LOGIN'] || >> "/login.php" >>>>>>>>>> WWW_PATH_ADD = ENV['WWW_PATH_ADD'] || "/add.php" >>>>>>>>>> WWW_PATH_INSTALL = ENV['WWW_PATH_INSTALL'] || "/ >>>>>>>>>> install.php" >>>>>>>>>> >>>>>>>>>> Right now that code is in session.rb. It seems the best way >>>>>>>>>> to >> do >>>>>>>>>> this >>>>>>>>>> is to allow people to set these parameters in the >> facebooker.yml >>>>>>>>>> optionally, and if they are not set then it defaults to >> Facebook >>>>>>>>>> addresses. I just don't know the best way to make the >>>> configuration >>>>>>>>>> portable. >>>>>>>>>> >>>>>>>>>> On Mon, Mar 31, 2008 at 12:39 PM, David Clements >>>>>>>>>> wrote: >>>>>>>>>>> Can you submit this as a patch, with tests, I have a bebo >>>>>>>>>>> adapter that I >>>>>>>>>>> have been working on so I can take a look and see if it fits >> in >>>>>>>>>>> with that, >>>>>>>>>>> as I have had similar issues. >>>>>>>>>>> >>>>>>>>>>> Dave >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Mon, Mar 31, 2008 at 11:28 AM, Jonathan Otto >>>> >>>>>>>>>>> >>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I am requesting that we change the paths that absolutely >> point >>>> to >>>>>>>>>>>> the >>>>>>>>>>>> facebook URL. >>>>>>>>>>>> >>>>>>>>>>>> In the PHP client there is a method in the facebook.php >>>>>>>>>>>> file >>>>>>>>>>>> called >>>>>>>>>>>> get_facebook_url() so this is easy to change there. >>>>>>>>>>>> >>>>>>>>>>>> One reason for this: >>>>>>>>>>>> >>>>>>>>>>>> Ringside Networks is a drop in replacement for Facebook >>>>>>>>>>>> that >>>>>>>>>>>> can be >>>>>>>>>>>> used for localhost development and eventually an >>>>>>>>>>>> abstraction >> for >>>>>>>>>>>> most >>>>>>>>>>>> social networks - it mimics the Facebook API so the >> Facebooker >>>>>>>>>>>> client >>>>>>>>>>>> works except for the URLs pointing to the Facebook >>>>>>>>>>>> domain. I >>>> have >>>>>>>>>>>> changes ready if Mike Mangino or anyone else is willing to >>>> commit >>>>>>>>>>>> them. >>>>>>>>>>>> >>>>>>>>>>>> http://wiki.ringsidenetworks.org/display/ringside/Home >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> 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 >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>>> -- >>>>>> Mike Mangino >>>>>> http://www.elevatedrails.com >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>> >> >> From tobyhede at info-architects.net Wed Apr 2 21:23:50 2008 From: tobyhede at info-architects.net (Toby Hede) Date: Thu, 3 Apr 2008 12:23:50 +1100 Subject: [Facebooker-talk] loading settings from database Message-ID: I'm just wondering what the best way to go about loading my API keys from the database is ... Should I simply place them in the ENV variable? Is there a way better way to go about this? From jonathan.otto at gmail.com Wed Apr 2 22:47:11 2008 From: jonathan.otto at gmail.com (Jonathan Otto) Date: Wed, 2 Apr 2008 21:47:11 -0500 Subject: [Facebooker-talk] loading settings from database In-Reply-To: References: Message-ID: You'll probably have to modify the plugin, at least Facebooker::Session since right now the API key is loaded once at plugin initialization, and if you're running more than 1 app, you'll need to signal some way to indicate which keys to load. One way to do this is to check for parameters in Application.rb with a before_filter and set a new variable in the Facebooker::Session class. Keep us updated on your progress, this would be a great contribution. On Wed, Apr 2, 2008 at 8:23 PM, Toby Hede wrote: > I'm just wondering what the best way to go about loading my API keys > from the database is ... > > Should I simply place them in the ENV variable? > > Is there a way better way to go about this? > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > From tobyhede at info-architects.net Thu Apr 3 00:19:06 2008 From: tobyhede at info-architects.net (Toby Hede) Date: Thu, 3 Apr 2008 15:19:06 +1100 Subject: [Facebooker-talk] loading settings from database In-Reply-To: References: Message-ID: At the moment I just have a before_filter in my controller: ENV['FACEBOOK_API_KEY'] = @app.api_key ENV['FACEBOOK_SECRET_KEY'] = @app.secret_key Which seems to be working fine. On Thu, Apr 3, 2008 at 1:47 PM, Jonathan Otto wrote: > You'll probably have to modify the plugin, at least > Facebooker::Session since right now the API key is loaded once at > plugin initialization, and if you're running more than 1 app, you'll > need to signal some way to indicate which keys to load. > > One way to do this is to check for parameters in Application.rb with a > before_filter and set a new variable in the Facebooker::Session class. > > Keep us updated on your progress, this would be a great contribution. > > > > On Wed, Apr 2, 2008 at 8:23 PM, Toby Hede wrote: > > I'm just wondering what the best way to go about loading my API keys > > from the database is ... > > > > Should I simply place them in the ENV variable? > > > > Is there a way better way to go about this? > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > From phylae at gmail.com Thu Apr 3 00:42:21 2008 From: phylae at gmail.com (Paul Cortens) Date: Wed, 2 Apr 2008 21:42:21 -0700 Subject: [Facebooker-talk] including the original message in replies Message-ID: Hi, I don't know how most of you get these messages, but I get the digest version. It seems that most people, when replying to a message, include all the previous messages in their reply. This means that when I read the digest version, I need to scroll through several pages of old emails to find the new ones. It doesn't make sense (to me) to be resend these old messages over and over again. Do you think we could try to reduce this? It also make reading these messages on my BlackBerry pretty much impossible. I am sorry if there is some valid reason to be doing it this way. If there is, please let me know and I'll crawl back into my shell. I don't want to be all whiny about it, but I thought it wouldn't hurt to mention it. By the way, I love facebooker. You have done an excellent job. It has put developing a facebook application within my reach :) Cheers, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080402/268c2bb2/attachment.html From digidigo at gmail.com Thu Apr 3 00:58:52 2008 From: digidigo at gmail.com (David Clements) Date: Wed, 2 Apr 2008 22:58:52 -0600 Subject: [Facebooker-talk] including the original message in replies In-Reply-To: References: Message-ID: Paul, I think that you must have digest turned on. You can change that by following the link at teh bottom of the email. Dave On Wed, Apr 2, 2008 at 10:42 PM, Paul Cortens wrote: > Hi, > > I don't know how most of you get these messages, but I get the digest > version. It seems that most > people, when replying to a message, include all the previous messages in their reply. This means that when I read the digest version, I need to scroll through several pages of old emails to find the new ones. It doesn't make sense (to > me) > to be resend these old messages over and over again. Do you think we could try to reduce this? > It also make reading these messages on my BlackBerry pretty much impossible. > > I am sorry if there is some valid reason to be doing it this way. If there > is, please let me know and I'll crawl back into my shell. I don't want to be > all whiny about it, but I thought it wouldn't hurt to mention it. > > By the way, I love facebooker. You have done an excellent job. It has put > developing a facebook application within my reach :) > > Cheers, > > Paul > > _______________________________________________ > 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/20080402/e4e525bf/attachment.html From mmangino at elevatedrails.com Thu Apr 3 09:38:57 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 3 Apr 2008 08:38:57 -0500 Subject: [Facebooker-talk] loading settings from database In-Reply-To: References: Message-ID: Are you trying to support multiple applications from a single application? I'm not a big fan of using Environment variables for this. In my local copy, I have methods on the Facebooker module, so that you can call Facebooker.api_key and Facebooker.secret_key. This seems a little cleaner to me. That would allow you to override those methods to pull them from the DB or do anything else. Mike On Apr 2, 2008, at 11:19 PM, Toby Hede wrote: > At the moment I just have a before_filter in my controller: > > ENV['FACEBOOK_API_KEY'] = @app.api_key > ENV['FACEBOOK_SECRET_KEY'] = @app.secret_key > > Which seems to be working fine. > > > > On Thu, Apr 3, 2008 at 1:47 PM, Jonathan Otto > wrote: >> You'll probably have to modify the plugin, at least >> Facebooker::Session since right now the API key is loaded once at >> plugin initialization, and if you're running more than 1 app, you'll >> need to signal some way to indicate which keys to load. >> >> One way to do this is to check for parameters in Application.rb >> with a >> before_filter and set a new variable in the Facebooker::Session >> class. >> >> Keep us updated on your progress, this would be a great contribution. >> >> >> >> On Wed, Apr 2, 2008 at 8:23 PM, Toby Hede > > wrote: >>> I'm just wondering what the best way to go about loading my API keys >>> from the database is ... >>> >>> Should I simply place them in the ENV variable? >>> >>> Is there a way better way to go about this? >>> _______________________________________________ >>> 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 marcotully at gmail.com Thu Apr 3 18:09:36 2008 From: marcotully at gmail.com (Marco Tully) Date: Thu, 3 Apr 2008 15:09:36 -0700 Subject: [Facebooker-talk] routes.rb definitions not working??? Message-ID: Hello Eveyone, I am new here, and am have no idea how to setup routes in the routes.rb file while using fbml. The regular map.resources :gifts map.resources :wishlists map.resources :invitations map.resources :comments does not work. This tutorial http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/ says to create a map.root, such as the one mentioned "map.root 'workshop'". Other places mention adding :conditions => {:canvas=>true,:method=>:gets}. I have tried map.root :controller => ="wishlists", :action => "index" and it does not work. And the other routes are not working either. What is the correct way to declare facebooker routes? Cheers!! Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080403/c23fc793/attachment.html From mmangino at elevatedrails.com Thu Apr 3 18:29:44 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Thu, 3 Apr 2008 17:29:44 -0500 Subject: [Facebooker-talk] routes.rb definitions not working??? In-Reply-To: References: Message-ID: <9B760C07-8E96-4320-93DE-81624CFDA535@elevatedrails.com> Can you explain what you are trying to do? map.resource :gifts does in fact work, as does map.root :controller=>"wishlists" What error do you see? Mike On Apr 3, 2008, at 5:09 PM, Marco Tully wrote: > Hello Eveyone, > > I am new here, and am have no idea how to setup routes in the > routes.rb file while using fbml. The regular > > map.resources :gifts > map.resources :wishlists > map.resources :invitations > map.resources :comments > > does not work. > > This tutorial http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/ > > says to create a map.root, such as the one mentioned "map.root > 'workshop'". Other places mention adding > > :conditions => {:canvas=>true,:method=>:gets}. > > > I have tried > > map.root :controller => ="wishlists", :action => "index" > > and it does not work. > > And the other routes are not working either. What is the correct > way to declare facebooker routes? > > Cheers!! > > Marco > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk -- Mike Mangino http://www.elevatedrails.com From marcotully at gmail.com Thu Apr 3 19:12:23 2008 From: marcotully at gmail.com (Marco Tully) Date: Thu, 3 Apr 2008 16:12:23 -0700 Subject: [Facebooker-talk] routes.rb definitions not working??? In-Reply-To: <9B760C07-8E96-4320-93DE-81624CFDA535@elevatedrails.com> References: <9B760C07-8E96-4320-93DE-81624CFDA535@elevatedrails.com> Message-ID: I get an "Error while loading page" to show up. ActionView::TemplateError (undefined local variable or method `create_wishlist_path'. I have been getting all types of these errors weather it is create_wishlist_path or new_wishlist_path, or gifts_path. None of them seem to be working. No idea why? Actually, after looking through my development log, some of them seem to be working while others are clearly not recognized, but for some reason, the ones that are working are not being displayed to the facebook canvas. That is when I get a "Error while loading page" No idea why. On Thu, Apr 3, 2008 at 3:29 PM, Mike Mangino wrote: > Can you explain what you are trying to do? map.resource :gifts does in > fact work, as does map.root :controller=>"wishlists" > > What error do you see? > > Mike > > > On Apr 3, 2008, at 5:09 PM, Marco Tully wrote: > > > Hello Eveyone, > > > > I am new here, and am have no idea how to setup routes in the routes.rb > > file while using fbml. The regular > > > > map.resources :gifts > > map.resources :wishlists > > map.resources :invitations > > map.resources :comments > > > > does not work. > > > > This tutorial > > http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/ > > > > says to create a map.root, such as the one mentioned "map.root > > 'workshop'". Other places mention adding > > > > :conditions => {:canvas=>true,:method=>:gets}. > > > > > > I have tried > > > > map.root :controller => ="wishlists", :action => "index" > > > > and it does not work. > > > > And the other routes are not working either. What is the correct way to > > declare facebooker routes? > > > > Cheers!! > > > > Marco > > _______________________________________________ > > 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/20080403/810ce7db/attachment-0001.html From sbwoodside at yahoo.com Fri Apr 4 03:20:42 2008 From: sbwoodside at yahoo.com (S. Woodside) Date: Fri, 4 Apr 2008 03:20:42 -0400 Subject: [Facebooker-talk] something wrong with event_members Message-ID: <876E3C9B-F4A2-414D-9B2C-2A532683F69C@yahoo.com> I've got this code in one of my views: <% for event in @facebook_session.events( :uid => @facebook_user.uid ) %>

<%= @facebook_session.event_members(event.eid).length %>

<% end %> It should print the # of people coming to each of this user's events. Let's say that would be "5 12 8". Instead it's printing "5 5 5", in other words, the # of people going to the first event, repeated over and over again for each of the other events. Is there something wrong with my code, or something wrong with facebooker? Is it caching something wrong maybe??? --simon -- http://simonwoodside.com From mmangino at elevatedrails.com Fri Apr 4 08:41:55 2008 From: mmangino at elevatedrails.com (Mike Mangino) Date: Fri, 4 Apr 2008 07:41:55 -0500 Subject: [Facebooker-talk] routes.rb definitions not working??? In-Reply-To: References: <9B760C07-8E96-4320-93DE-81624CFDA535@elevatedrails.com> Message-ID: <47375A8B-4766-48DC-A11A-15DC7DC9E1A7@elevatedrails.com> create_wishlist_path isn't a valid path. You want to do a POST to wishlists_path() There was an old version of routing for Facebook that used these non- standards path, but that hasn't existed for months :) Mike On Apr 3, 2008, at 6:12 PM, Marco Tully wrote: > I get an "Error while loading page" to show up. > ActionView::TemplateError (undefined local variable or method > `create_wishlist_path'. I have been getting all types of these > errors weather it is create_wishlist_path or new_wishlist_path, or > gifts_path. None of them seem to be working. No idea why? > > Actually, after looking through my development log, some of them > seem to be working while others are clearly not recognized, but for > some reason, the ones that are working are not being displayed to > the facebook canvas. That is when I get a "Error while loading > page" No idea why. > > On Thu, Apr 3, 2008 at 3:29 PM, Mike Mangino > wrote: > Can you explain what you are trying to do? map.resource :gifts does > in fact work, as does map.root :controller=>"wishlists" > > What error do you see? > > Mike > > > On Apr 3, 2008, at 5:09 PM, Marco Tully wrote: > Hello Eveyone, > > I am new here, and am have no idea how to setup routes in the > routes.rb file while using fbml. The regular > > map.resources :gifts > map.resources :wishlists > map.resources :invitations > map.resources :comments > > does not work. > > This tutorial http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/ > > says to create a map.root, such as the one mentioned "map.root > 'workshop'". Other places mention adding > > :conditions => {:canvas=>true,:method=>:gets}. > > > I have tried > > map.root :controller => ="wishlists", :action => "index" > > and it does not work. > > And the other routes are not working either. What is the correct > way to declare facebooker routes? > > Cheers!! > > Marco > _______________________________________________ > 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 heavysixer at gmail.com Fri Apr 4 22:45:07 2008 From: heavysixer at gmail.com (Heavy Sixer) Date: Fri, 4 Apr 2008 21:45:07 -0500 Subject: [Facebooker-talk] url_for + :canvas => false weirdness for non resource controllers Message-ID: <6B47DB67-52EC-45E9-9919-20C52EB63F7E@gmail.com> I noticed something strange in my app today. It appears that the extra canvas path appended in url_for is back but only for controllers that are not resources. Here is an example I have in my site: campaigns is a resource checkout is not # With the canvas false flag (rdb:1) @controller.url_for(:controller => 'campaigns', :action => 'show', :id => 1,:canvas => false,:only_path => true) "/campaigns/1" (rdb:1) @controller.url_for(:controller => 'checkout', :action => 'ipn',:canvas => false,:only_path => true) "/pledgie/checkout/ipn" # With the canvas true flag (rdb:1) @controller.url_for(:controller => 'campaigns', :action => 'ipn',:canvas => true,:only_path => true) "/pledgie/campaign/1" (rdb:1) @controller.url_for(:controller => 'checkout', :action => 'ipn',:canvas => true,:only_path => true) "/pledgie/pledgie/checkout/ipn" Notice that the non resource controller "checkout" has an extra canvas path applied to it. Anyone know a way around this? Mark From prateek.dayal at gmail.com Sat Apr 5 12:41:18 2008 From: prateek.dayal at gmail.com (Prateek Dayal) Date: Sat, 5 Apr 2008 22:11:18 +0530 Subject: [Facebooker-talk] Facebooker updates In-Reply-To: References: <3945EF55-EBF0-4153-A5C7-10CE7710C62A@elevatedrails.com> Message-ID: Hi This is my first poting on the list. Please excuse me if this has bug has already been resolved. However its not fixed in the code as I checked out the latest copy sometime back. (rest inline) On Thu, Mar 27, 2008 at 10:05 PM, Jonathan Otto wrote: > Yes, I am getting an error in Firebug that says the replace function > is not allowed. This is happening when you do something like <% remote_form_for Comment.new, :url=>comment_url(:canvas=>false), :update=>'all_comments' do |f|%> <%= f.text_area :comment %> ..... <%end-%> This passes a javascript object (Comment object) to encodeURIComponent(str) which is expecting a string. Therefore an error is raised. If you use <%=text_area_tag :comment%>, then it works as expected. I verified this by using breakpoints in firebug. I am not very proficient in javascript so I cannot come up with a patch. Hope this helps Regards Prateek > > On Thu, Mar 27, 2008 at 8:21 AM, Mike Mangino > > > wrote: > > Facebook puts fb_sig_is_ajax in the form, not facebooker. > > > > Are you using :canvas=>false and including facebooker.js? > > > > Mike > > > > > > > > On Mar 26, 2008, at 11:44 PM, Jonathan Otto wrote: > > > link_to_remote is working great. Access restful resources by > > > specifying :_method => :post or :get. > > > > > > Now, remote_form_for is not putting fb_sig_is_ajax in the POST params, > > > so I suspect it is not working correctly. Has anyone else tested > > > remote_form_for? > > > > > > Mike, thanks for your work here, this is a great addition. > > > > > > On Fri, Mar 14, 2008 at 4:46 PM, Mike Mangino > > > wrote: > > >> Not directly. My version of it returns the response as JSON. Facebook > > >> doesn't give any means of executing javascript, so none of the RJS > > >> type features will work. > > >> > > >> Mike > > >> > > >> > > >> > > >> On Mar 14, 2008, at 3:29 PM, David Clements wrote: > > >> > > >>> Hey Mike, > > >>> > > >>> Did you have any success getting new Ajax.Request to work? This is > > >>> the one that gets generated when you do an link_to_remote without > > >>> the update => div_id. > > >>> > > >>> I could have sworn during some testing I did a few weeks ago that > > >>> this would work if you wrapped your return RJS in