Created
May 11, 2020 21:21
-
-
Save halfak/a497ea370eabc93a66428e7b78996435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 3.5.1+ (default, Mar 30 2016, 22:46:26) | |
[GCC 5.3.1 20160330] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import requests | |
>>> import mwapi | |
>>> session = mwapi.Session("https://deployment.wikimedia.beta.wmflabs.org/") | |
Sending requests with default User-Agent. Set 'user_agent' on mwapi.Session to quiet this message. | |
>>> session.get(action='query', meta="tokens", format="json") | |
{'query': {'tokens': {'csrftoken': '+\\'}}, 'batchcomplete': ''} | |
>>> session.post(action='jadeproposeorendorse', title='Jade:Diff/123', facet='editquality', labeldata='{"damaging": false, "goodfaith": true}', notes="test", endorsementorigin="foo", token='+\\') | |
{'data': {'facets': {'editquality': {'proposals': [{'endorsements': [{'comment': 'As proposer', 'created': '2020-05-11T21:20:31+00:00', 'origin': 'foo', 'touched': '2020-05-11T21:20:31+00:00', 'author': {'ip': '73.94.56.86'}}], 'preferred': '', 'author': {'ip': '73.94.56.86'}, 'labeldata': {'goodfaith': ''}, 'notes': 'test'}]}}}} |
Author
halfak
commented
May 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment