On Sun, 2009-07-05 at 11:01 +0200, Loic Dachary wrote: > -----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/
Hi, I made primitive integration of a jpoker widget into opensocial: http://upstream.jspoker.pokersource.info/raw-file/tip/jpoker-opensocial.xml You can try it out there: http://shindig.opensocial.dachary.org/gadgets/ifr?url=http://upstream.jspoker.pokersource.info/raw-file/tip/jpoker-opensocial.xml I also filled the following bug in shindig: "ProxyHandler fetch/fetchJson methods always returns 404 on error" https://issues.apache.org/jira/browse/SHINDIG-1106 Currently is relies on a jsonp trick, setting CONTENT_TYPE = gadgets.io.ContentType.TEXT, and running eval on the proxified result, instead of native opensocial gadgets.io.json.parse (when CONTENT_TYPE = gadgets.io.ContentType.JSON). It could be deprecated as soon as poker-network implemente: "opensocial : poker-network must accept POKER_REST content from content field" https://gna.org/task/index.php?6656 Feedbacks are welcome. -- Johan Euphrosine <[email protected]>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Pokersource-users mailing list [email protected] https://mail.gna.org/listinfo/pokersource-users
