[Mediawiki-api-announce] BREAKING CHANGE: list={backlinks, embeddedin, imageusage} no longer return arrays with pageIDs as keys (was: Inconstisent [sic] formatting of results in JSON)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Mediawiki-api-announce] BREAKING CHANGE: list={backlinks, embeddedin, imageusage} no longer return arrays with pageIDs as keys (was: Inconstisent [sic] formatting of results in JSON)

Roan Kattouw
This change only affects clients using the JSON, PHP, WDDX, PHP, TXT and
DBG formats. If you're using the XML or YAML formats, nothing will
change for you.

The list=backlinks, list=embeddedin and list=imageusage used to return
arrays with pageIDs as keys, duplicating information (those arrays also
contain the pageID). An example (in JSON):

{
        "query": {
                "backlinks": {
                        "1024": {
                                "pageid": "1024",
                                "ns": 1,
                                "title": "Talk:Anarcho-capitalism"
                        },
                        "1236": {
                                "pageid": "1236",
                                "ns": 1,
                                "title": "Talk:Algorithm"
                        }
                }
        }
}


After a complaint [1] about this behavior, it was changed in r39645 [2].
Like all other list= modules, backlinks and friends now return arrays
with 0, 1, 2, etc. as keys. In JSON this looks like:

{
        "query": {
                "backlinks": [
                        {
                                "pageid": "1024",
                                "ns": 1,
                                "title": "Talk:Anarcho-capitalism"
                        },
                        {
                                "pageid": "1236",
                                "ns": 1,
                                "title": "Talk:Algorithm"
                        }
                ]
        }
}

Roan Kattouw (Catrope)

[1]
http://lists.wikimedia.org/pipermail/mediawiki-api/2008-August/000657.html
[2] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=39645


_______________________________________________
Mediawiki-api-announce mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: [Mediawiki-api-announce] BREAKING CHANGE: list={backlinks, embeddedin, imageusage} no longer return arrays with pageIDs as keys (was: Inconstisent [sic] formatting of results in JSON)

Jools Wills
Thanks for making these changes and your continued work on the API (Which
has put an end to huge amounts of screenscraping horribleness which I
previously had to endure!)

<3 $wgEnableWriteAPI = true;

Best Regards

Jools



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: [Mediawiki-api-announce] BREAKING CHANGE: list={backlinks, embeddedin, imageusage} no longer return arrays with pageIDs as keys (was: Inconstisent [sic] formatting of results in JSON)

Roan Kattouw
Jools Smyth schreef:
> Thanks for making these changes and your continued work on the API (Which
> has put an end to huge amounts of screenscraping horribleness which I
> previously had to endure!)
>  
Let's not forget Yuri Astrakhan here: the API and query.php (its
predecessor) were his brainchildren. There's still a lot of Yuri's code
in the API, despite the fact he's not touched the code for over a year now.
> <3 $wgEnableWriteAPI = true;
Well yes, that *was* my project from the start.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api