[Facebooker-talk] request for change in URL pointing to facebook domain

Jonathan Otto jonathan.otto at gmail.com
Tue Apr 1 02:58:57 EDT 2008


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
<mmangino at elevatedrails.com> 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
>  >> <digidigo at gmail.com> 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
>
>
>
>


More information about the Facebooker-talk mailing list