demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Demexp-dev] First XML RPC proxy available


From: David MENTRE
Subject: [Demexp-dev] First XML RPC proxy available
Date: Sun, 03 Sep 2006 18:17:58 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Hello,

I've setup a basic XML RPC <-> ONC RPC proxy at:
  http://www.linux-france.org/cgi-bin/demexp-xmlrpc-demo

This proxy handles XML RPC calls and calls in turn the demo server
(demo.demexp.org:50000) over ONC RPC.

Currently, supported RPC methods are login(), question_info() and
max_question_id().

This proxy is a very first attempt and should be quite buggy, but it
should help Augustin to continue his work.

Example of use in Python:

>>> from xmlrpclib import *
>>> s = ServerProxy("http://www.linux-france.org/cgi-bin/demexp-xmlrpc-demo";)
>>> s.login("demo", "demo")
229422517


Augustin, using max_question_id() and question_info() with a value of 0
(zero) as cookie, you should be able to get details on questions and
write your Drupal code. Let me know of any issue. In the meantime, I'll
try to extend that code.

>>> from xmlrpclib import *
>>> s = ServerProxy("http://www.linux-france.org/cgi-bin/demexp-xmlrpc-demo";)
>>> s.max_question_id(0)
270
>>> s.question_info(0, 0, 1)
[{'q_id': 0, 'q_info_num_votes': 21, 'q_info_limit_date': 0, 'q_desc': 'Est-ce 
que vous trouvez demexp utilisable ?', 'q_info_elected_responses': [2], 
'q_timestamp': 24115814, 'q_info_status': 2, 'q_info_responses': 
[{'r_info_desc': 'Question rejected', 'r_info_link': ''}, {'r_info_desc': 
u'Ind\xe9cis', 'r_info_link': ''}, {'r_info_desc': 'Oui', 'r_info_link': ''}, 
{'r_info_desc': 'Non', 'r_info_link': ''}, {'r_info_desc': u'm\xeame le 
dimanche?', 'r_info_link': ''}, {'r_info_desc': 'oui', 'r_info_link': ''}, 
{'r_info_desc': u'Uniquement avec un \xe9cran large', 'r_info_link': ''}, 
{'r_info_desc': 'A qd la langue francaise ?', 'r_info_link': ''}, 
{'r_info_desc': 'NON', 'r_info_link': ''}, {'r_info_desc': 'Difficile pour un 
non informaticien', 'r_info_link': ''}]}]

For those interested, the latest code is avaible in a Mercurial
repository:
 http://www.linux-france.org/cgi-bin/hgwebdir.cgi/demexp/xmlrpc-proxy

Best wishes,
d.
-- 
GPG/PGP key: A3AD7A2A David MENTRE <address@hidden>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A




reply via email to

[Prev in Thread] Current Thread [Next in Thread]