Tuesday, 15 March 2011

php - Using MediaWiki API with the Continue Command -


itemprop = "text">

I need some help using the MediaWiki API with "wiki" or "query-release" to draw information from my wiki Command article for. I have a large number of wiki articles (currently over 800) and I need to use the API to draw in 50 batches and then print the O segments.

My API call works properly:

// I am creating Strackworld to use a valid URL, this API is actually my own local host server, I am checking all the pages, so "apfrom" and "apito"

I need help in processing with PHP and CRL to access the API and processing 50 batches and using "release" until I end up, so far my PHP code Is:

  // Here curl commands work and output a data set, but only for the first 50 records, so let me call "continue" to come to the end the wanted . // My API URL is a localhost but I use a valid URL at StackHowarflow.com $ url = sprintf ('http://en.wikipedia.org/w/api.php?action = query & list = allpages & amp; ;; Apfrom = a & amp; apto = z & apnamespace = 0 & amp; format = xml & aplimit = 50 '); $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ CH, CURLOPT_USERAGENT, 'My Site'); $ Res = curl_exec ($ ch); $ Release = ''; Whereas (// I do not know where to set the truth to uphold the time, maybe that is to be true =? Probably decide the question-continue as correct?) {// maybe let me res $ [ Else-stay] ?? If (empty ($ res ['query-release'])) {exit; } And {$ release = '& amp; Apcontinue = '. Urlencode ($ res ['query-release']); $ V as foreign currency ($ res ['query'] ['allpages'] {echo $ v ['title']; }}}   

Can someone correct me my loop code, so I can print out a simple print from the title of each wiki in the loop? I have done a lot in searching online but I am stuck !! I got an example of a dragon loop, but I have to do it in PHP and I'm not sure if I continue to call or query-release.

As svick said, please, who handles continuity for you.

The query continuity mechanism has changed in MediaWiki many times, you do not want to understand it or trust less than that.

No comments:

Post a Comment