API talk:Raw query continue
Add topicAppearance
Latest comment: 10 years ago by RobinHood70 in topic Removal of optional continue method
Logic Problem or MediaWiki Bug?
[edit]I rather suspect the first, but if so, is it on my end or in the logic presented on the page? According to the logic on this page as I understand it, when I hit the generator's continue, I send the following and get the result below it:
Extended content |
---|
http://www.mediawiki.org/w/api.php ? action=query & titles=API:Main%20page & generator=categories & prop=categories|links & gcllimit=2 & cllimit=1 & gclcontinue=14588|MediaWiki_API_Overview & format=json { "query-continue": { "links": { "plcontinue": "12565|14|MediaWiki_Development/ca" }, "categories": { "gclcontinue": "14588|New_contributors", "clcontinue": "67186|MediaWiki_API" } } (...) } |
Great, looks good so far. Then, I ask for the next block:
Extended content |
---|
http://www.mediawiki.org/w/api.php ? action=query & titles=API:Main%20page & generator=categories & prop=categories|links & gcllimit=2 & cllimit=1 & plcontinue=12565|14|MediaWiki_Development/ca & clcontinue=67186|MediaWiki_API & format=json { "query-continue": { "categories": { "gclcontinue": "14588|MediaWiki_API_Overview" } } (...) } |
I trust the infinite loop is clear. :) – RobinHood70 talk 07:50, 14 January 2014 (UTC)
- Never mind, I got it figured out. You have to keep emitting the same gclcontinue once you've first emitted it. That's not clear from the page; I'll go clarify it. – RobinHood70 talk 08:13, 14 January 2014 (UTC)
- Thanks for the clarification. I suggest you switch to the new continue model, as it handles these issues automatically, and makes the client code much shorter and cleaner. --Yurik (talk) 08:29, 14 January 2014 (UTC)
- A bit of a late reply, but... I wish I could! I'm writing a general purpose bot, so I can't assume that the new continue model will always be available. There are plenty of wikis still out there running on versions less than 1.21. – RobinHood70 talk 01:56, 19 May 2014 (UTC)
- In that case i would recommend implementing the bot that supports the latest version, and doing a local simulation of that functionality. --Yurik (talk) 02:07, 19 May 2014 (UTC)
- Already done. As suggested in the docs, it adds a
continue=
to each query and then waits till one of the requests returns acontinue
orquery-continue
block to figure out what it should be using from that point forward. If the site returns an old-style continue, it'll stop adding thecontinue=
on any future requests. I may change the logic slightly to only add continues to queries that are actually continuable, but I'm undecided on that, since what's not-continuable today may become continuable tomorrow. – RobinHood70 talk 20:37, 21 May 2014 (UTC)
- Already done. As suggested in the docs, it adds a
- In that case i would recommend implementing the bot that supports the latest version, and doing a local simulation of that functionality. --Yurik (talk) 02:07, 19 May 2014 (UTC)
- A bit of a late reply, but... I wish I could! I'm writing a general purpose bot, so I can't assume that the new continue model will always be available. There are plenty of wikis still out there running on versions less than 1.21. – RobinHood70 talk 01:56, 19 May 2014 (UTC)
- Thanks for the clarification. I suggest you switch to the new continue model, as it handles these issues automatically, and makes the client code much shorter and cleaner. --Yurik (talk) 08:29, 14 January 2014 (UTC)
Removal of optional continue method
[edit]I've removed the second continue method (retain all props and emit continues from all of them) because it has a fatal flaw in the logic: if some modules never emit a continue, their data will be repeated with each request. This can lead to some rather large result sets. – RobinHood70 talk 06:41, 8 October 2014 (UTC)