Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot flag in page create #25

Closed
hyperreal-info opened this issue Apr 5, 2015 · 2 comments
Closed

bot flag in page create #25

hyperreal-info opened this issue Apr 5, 2015 · 2 comments

Comments

@hyperreal-info
Copy link

the bot flag in page creation is ignored by wikitools at the moment, why?

@alexz-enwp
Copy link
Owner

Works for me. Keep in mind that bot flags are only shown in recentchanges/watchlist, not page history.

>>> import pprint
>>> import settings
>>> from wikitools import *
>>> site = wiki.Wiki('https://en.wikipedia.org/w/api.php')
>>> site.login(settings.bot, settings.botpass)
True
>>> p = page.Page(site, 'User:Mr.Z-man/test123')
>>> p.exists
False
>>> res = p.edit(text='Test', summary='Test', bot=True)
>>> res
{u'edit': {u'pageid': 46323959, u'title': u'User:Mr.Z-man/test123', u'newtimestamp': u'2015-04-05T18:46:12Z', u'contentmodel': u'wikitext', u'result': u'Success', u'new': u'', u'oldrevid': 0, u'newrevid': 655076325}}
>>> params = {'action':'query', 'list':'recentchanges', 'rcuser':'Mr.Z-bot', 'rclimit':1, 'rcprop':'title|flags'}
>>> req = api.APIRequest(site, params)
>>> pprint.pprint(req.query(False))
{u'query': {u'recentchanges': [{u'bot': u'',
                                u'new': u'',
                                u'ns': 2,
                                u'title': u'User:Mr.Z-man/test123',
                                u'type': u'new'}]},
 u'query-continue': {u'recentchanges': {u'rccontinue': u'20150405111706|726410422'}},
 u'warnings': {u'query': {u'*': u"Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."}}}

@hyperreal-info
Copy link
Author

bot flags are only shown in recentchanges/watchlist, not page history

Thanks, I was not aware of this. Sorry for a false report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants