Re: [Demexp-dev] Retrieving questions

2007-11-06 Par sujet Lyu Abe

Hi Diogene!


Until now I just worked on the 100 first questions so : no problem..
Or near to.. :)


Great!


I tried even a [100, 101] intervalle but I get the same answer ??

@@@ Im not sure but Lyu, didnt you have the same issue, no ?


David just replied, but question_info is:
question_info(cookie, first question to retrieve, number of question to 
retrieve)


Regards, Lyu


___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev


Re: [Demexp-dev] Retrieving questions

2007-11-06 Par sujet David MENTRE
Hello Diogene,

2007/11/6, Diogene Laerce <[EMAIL PROTECTED]>:
> // Questions download : Send a message to the server.
> $message = new xmlrpcmsg('question_info', array(new
> xmlrpcval($cookie_dm, "int"), new xmlrpcval(100, "int"), new
> xmlrpcval(200, "int")));

As I said previously[1], the number of question requested is limited
to 100. Here you are requesting 200 questions, from number 100 to
number 299.


> rt_request_too_much_ids

That's why the server rejects your request. The error message means:
you request to many items at once.

Try instead:
 $message = new xmlrpcmsg('question_info', array(new
xmlrpcval($cookie_dm, "int"),

   new xmlrpcval(100, "int"),

   new xmlrpcval(100, "int")));


Yours,
d.

[1] http://article.gmane.org/gmane.politics.organizations.demexp.devel/1452


___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev


Re: [Demexp-dev] Retrieving questions

2007-10-23 Par sujet David MENTRE
Hi Diogene,

2007/10/23, Diogene Laerce <[EMAIL PROTECTED]>:
> Is it possible to download the bases.dmxp (xml format) from the server
> and where ?

No. The bases.dmxp file contains sensitive information (who has voted
on what) and is never going to be released to the public.

> Purpose : The search engine would need to update its corpus
> automatically (every day or week), and so will need to connect to the
> base to download it all, parse the xml and build a new xml file it could
> read (with the proper headers).

Use the regular RPC API to get the update on each question. There is a
timestamp mechanism to know if a question has been changed. Look at
RPC get_timestamp() in the demexp book.

In short, a timestamp, an integer counter, is incremented each time a
question, tag, etc. is modified. You have the timestamp in the data
structure of each question, tag, etc. Moreover, you can use the
get_timestamp() RPC to get all the timestamps at once.

As an added bonus, on the XML-RPC proxy, you have two RPCs available:
 * get_timestamp(), the same as the get_timestamp() ONC-RPC;

 * get_timestamp_decoded(), returns the timestamp as arrays of
integers (instead of the compressed version of the get_timestamp()
RPC).

So, if you want to check at regular interval all the questions, you should:

 * Issue get_timestamp() (or get_timestamp_decoded()) to get all the
timestamps. Compare the returned value with the value you stored.

 * For each question that has a different timestamp, issue a
question_info() to update your local copy of the question.

Yours,
d.


___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev