« Remote Scripting with AJAX – Article review | Main | Seattle Movie finder – Article review »

More on the Facebook API for our Project

Answer to Bud’s comment:

“My suspicion is that you might have been able to do this with AJAX and a proxy. [...] That’s not to say PHP is bad. It's just that I personally am trying to avoid server side programming.”

One approach - which we might use in iteration one - is letting the user logon to Facebook and send him (together with the token) back to the PHP page on which we will establish the connection and extract the details of the friends. This would be done completely in PHP; the first part of the PHP file would get and handle the data from Facebook (create arrays etc) while the second part would do the GeoCoding on the fly and display it all on the GoogleMap. So the user would get a HTML page tailored on the server (which might be load for a while if the user has 700 friends) and sent completely to the client without further requests against the server. The scenario as described involves no AJAX and is therefore not desired for further iterations. For the second iteration we want to try to load the complete page including the GoogleMap and to never reload them. This could work if the user clicks on the login button (which will be located in the area in which the friends will be listed later on) which opens a popup and redirects him to the Facebook login page, he logs in, returns back to a PHP page (still in the Popup) which would just initializes a session and close itself. Then the user could click on “start application/get friends” and an XML file could be fetched from the server from a PHP script which does nothing more than just returning the XML; this would be the AJAX way, the file would be transferred and processed on the client side (this function could also be invoked from the PHP page in the popup before it closes itself). However, we first would first need to figure out how the session id which was generated in the popup can be transferred to the main page on which it is needed. But I think there should be JavaScript functions available.

A third option might be a PHP proxy; but I don’t know what it is and how it works. But I guess the second option sounds like pretty much like a PHP proxy (at least my understanding of a proxy) which is just called with a few attributes to get a XML file back.

200702071330

Archives

Cool links

Blog Maintenance, EMUonline, Learningremix, Bud's Blog, Andre's Blog, Joern's Blog, Bud's Page, MYB-Tags, MYB-Joern, MYB-Andre, MYB-Thomas

Interesting stuff