[Top][All Lists]

[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)


I've setup a basic XML RPC <-> ONC RPC proxy at:

This proxy handles XML RPC calls and calls in turn the demo server
( over ONC RPC.

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

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("";)
>>> s.login("demo", "demo")

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("";)
>>> s.max_question_id(0)
>>> 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

Best wishes,
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]