Question about getting WikiProject articles using API

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

Question about getting WikiProject articles using API

Bowen Yu-2
Hi,

I am trying to get the articles that are tagged to a particular project using the API. My code was working like couple months ago, but not any more. 

Below is the url request I make, and it seems that projectpages is no longer on the API:Lists either. I wonder if anyone would know what's going on, or point me to resources? Thank you!

URL = 'https://en.wikipedia.org/w/api.php?action=query&format=json&list=projectpages&wpplimit=500&wppassessments=1&wppprojects=Military%20history'


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

Re: Question about getting WikiProject articles using API

Bartosz Dziewoński
This appears to be a bug. I filed
<https://phabricator.wikimedia.org/T186648>.

The API should still be available, it is listed here:
https://en.wikipedia.org/w/api.php?action=help&recursivesubmodules=1#query+projectpages

You won't find it on API:Lists because it's provided by an extension:
<https://www.mediawiki.org/wiki/Extension:PageAssessments>.

--
Bartosz Dziewoński

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

Re: Question about getting WikiProject articles using API

Bowen Yu-2
Got it. Thank you for clarification. Hope it will work again this Thursday at deployment!

On Tue, Feb 6, 2018 at 3:44 PM, Bartosz Dziewoński <[hidden email]> wrote:
This appears to be a bug. I filed <https://phabricator.wikimedia.org/T186648>.

The API should still be available, it is listed here: https://en.wikipedia.org/w/api.php?action=help&recursivesubmodules=1#query+projectpages

You won't find it on API:Lists because it's provided by an extension: <https://www.mediawiki.org/wiki/Extension:PageAssessments>.

--
Bartosz Dziewoński

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


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

Re: Question about getting WikiProject articles using API

Bowen Yu-2
Any update on this? I am still seeing the same error, or is that a bug from my side?

Here is the code:

import requests
response = requests.get(url).json()

Here is the error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bowen/Library/Python/3.4/lib/python/site-packages/requests/models.py", line 894, in json
    return complexjson.loads(self.text, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

Thank you!


On Tue, Feb 6, 2018 at 3:56 PM, Bowen Yu <[hidden email]> wrote:
Got it. Thank you for clarification. Hope it will work again this Thursday at deployment!

On Tue, Feb 6, 2018 at 3:44 PM, Bartosz Dziewoński <[hidden email]> wrote:
This appears to be a bug. I filed <https://phabricator.wikimedia.org/T186648>.

The API should still be available, it is listed here: https://en.wikipedia.org/w/api.php?action=help&recursivesubmodules=1#query+projectpages

You won't find it on API:Lists because it's provided by an extension: <https://www.mediawiki.org/wiki/Extension:PageAssessments>.

--
Bartosz Dziewoński

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



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

Re: Question about getting WikiProject articles using API

Bartosz Dziewoński
Looks like it was not fixed right. But now it's *really* fixed.

https://phabricator.wikimedia.org/T185037

--
Bartosz Dziewoński

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

Re: Question about getting WikiProject articles using API

Bowen Yu-2
Yes, it's working now. Thank you!!

On Mon, Feb 12, 2018 at 2:38 PM, Bartosz Dziewoński <[hidden email]> wrote:
Looks like it was not fixed right. But now it's *really* fixed.

https://phabricator.wikimedia.org/T185037


--
Bartosz Dziewoński

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


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