-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
Here is a summary of my exploration of the OpenSocial universe. My goal is to create an adapter for pokersource. We will use shindig ( http://incubator.apache.org/shindig/ ) ,the reference implementation for OpenSocial 0.8.1 ( http://www.opensocial.org/Technical-Resources/opensocial-spec-v081.html and more at http://www.opensocial.org/Technical-Resources/ ) as found at https://repository.apache.org/content/groups/public/org/apache/shindig/shindig/1.0-incubating/shindig-1.0-incubating-php.tar.gz released the 2009-06-19. It has been installed at http://shindig.opensocial.dachary.org/ and you can find a signed copy of the corresponding virtual machine at http://store01.binbang.org/ http://store01.binbang.org/opensocial.raw.gz The maintainer of Shindig is Chris Chabot and he is following the dev mailing list closely http://incubator.apache.org/shindig/mail-lists.html ( archives at http://mail-archives.apache.org/mod_mbox/incubator-shindig-dev/ ). Shindig is used in a variety of social networks, however, for debug and testing purposes we will use partuza ( http://code.google.com/p/partuza/ ), also developped by Chris Chabot and designed to provide an example social coupled with shindig. Although it could be used as a foundation for a full fledged social network, we will use it for debug purposes only. Partuza has been installed from http://partuza.googlecode.com/files/partuza-1.0.0.tar.gz on http://partuza.opensocial.dachary.org/. The live version that runs at http://partuza.nl/ is slightly different. This installation is also included in the virtual machine found at http://store01.binbang.org/opensocial.raw.gz In order to discover which URLs can be used for which purpose, partuza obeys the XRDS protocol at http://partuza.opensocial.dachary.org/xrds Creating an opensocial adapter for pokersource requires that we package jpoker ( http://jspoker.pokersource.info/ ) in a XML file describing an opensocial client application. Here is a very simple minded application that does nothing but can be installed on partuza: http://dachary.org/i.xml <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="hello world example" /> <UserPref name="myname" display_name="Name" required="true" /> <Content type="html"> <![CDATA[ Hello, world! __UP_myname__ ]]> </Content> </Module> You go to your account home page, ask to install the application by providing the URL to this XML file and it shows in the application section. The specifications for the content of the XML file are at http://code.google.com/apis/gadgets/docs/reference.html . The "Content" section will have HTML code to include jpoker. The http://www.labpixies.com/campaigns/todo/todo.xml example application shows how it can be done. In a nutshell, it's like a creating a regular HTML page with JavaScript files included and wrapped in meta information describing the application. Elements on how the XML file will be interpreted can be found at http://www.opensocial.org/Technical-Resources/opensocial-spec-v08/gadget-spec.html jpoker needs to communicate with the poker server and won't be able to do it because of cross browser restrictions. However, using the makeRequest method ( as described at http://www.opensocial.org/Technical-Resources/opensocial-spec-v08/gadgets-reference08 ) the XHR call will be proxied by the server. It will also need to get information about the player from the server and can make use of the opensocial JavaScript API to do so ( for instance, retrieving the gender of the player can be done with http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/opensocial-reference#opensocial.Person.getField to retrieve http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/opensocial-reference#opensocial.Enum.Gender ) The poker server sitting behind the social network will need to authenticate a user whenever it receives a request such as "PacketPokerSeat". It will be done by asking the server to sign each request proxied to the server on behalf of jpoker. By signing the request, the poker server knows the id of the user it reads in the opensocial_ownerid field is from a user that has identify himself ( http://wiki.opensocial.org/index.php?title=Validating_Signed_Requests ). The poker server will also need to store and retreive the user chips from the server. The opensocial server provides a storage space ( hash table ) for each application to use. There is a hash table for each user. When sending a request to the poker server, the opensocial server will also provide a key that allows the poker server to interact with the opensocial server. This interaction can be made using the http://code.google.com/p/opensocial-python-client/ ( it says client because it this case the poker server is a client of the opensocial server ). I've installed the PHP implementation of the same library at http://pokersource.info/opensocial-php-client/examples/ Cheers -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpQa94ACgkQ8dLMyEl6F2052ACZAeqZtUWyLovP0pbHnGLZpGg1 hTwAn2AANgGjmxPl6F6ZCSvC+A43cpSo =yUz9 -----END PGP SIGNATURE-----
begin:vcard fn:Loic Dachary n:Dachary;Loic org:pokersource adr:;;12 bd Magenta;Paris;;75010;France email;internet:[email protected] title:Senior Developer tel;work:+33 9 51 18 43 38 tel;cell:+33 6 64 03 29 07 x-mozilla-html:FALSE url:http://dachary.org/ version:2.1 end:vcard
_______________________________________________ Pokersource-users mailing list [email protected] https://mail.gna.org/listinfo/pokersource-users
