Closed jimsafley closed 13 years ago
Partially fixed: https://github.com/chnm/Scripto/commit/cfc0df7152c10e36d37c064d239a9cdf577efbe5
getPageWikitext() is not available in JSON format. Its relatively straightforward to switch getPageHtml() to JSON, but the getPreview() JSON syntax is difficult to traverse. Because of this, I decided not to convert these from XML, at least for now.
Remember to always decode JSON using json_decode($json, true)
. The true flag returns an array instead of the default stdClass object. An array is much easier to traverse than an object, particularly when using current()
to get the first element of an array.
Fixed in several commits.
Loading XML responses into SimpleXMLElement slows things down unnecessarily when a JSON response format is available. JSON would also simplify data traversal.