Coder Social home page Coder Social logo

bot flag in page create about wikitools HOT 2 CLOSED

alexz-enwp avatar alexz-enwp commented on July 1, 2024
bot flag in page create

from wikitools.

Comments (2)

alexz-enwp avatar alexz-enwp commented on July 1, 2024

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."}}}

from wikitools.

hyperreal-info avatar hyperreal-info commented on July 1, 2024

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

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

from wikitools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.