[pywikibot] Re: How to add a category to a page

2024-01-04 Thread John
I use a combination of getCategoryLinks() and then replaceCategoryLinks() it updates them in place, or adds them where needed. On Thu, Jan 4, 2024 at 2:58 AM wrote: > Hi, > > to add a category to several pages, category script can be used. For > implementing a function or method, its treat

[pywikibot] Re: Parallel gets?

2023-03-28 Thread John
If you are looking to check for image/file usage it’s better to query the api for just image used images instead of trying to parse wiki text On Tue, Mar 28, 2023 at 10:29 PM Roy Smith wrote: > On Mar 28, 2023, at 9:09 PM, Kunal Mehta wrote: > > I suppose it's also worth asking what you're

[pywikibot] Re: Parallel gets?

2023-03-27 Thread John
I’ve not checked in the v3+ version but there used to be a preload page generator that batch retrieved stuff from the API. Then pass the preloaded page object on to the parallel processing part. On Mon, Mar 27, 2023 at 3:58 PM Roy Smith wrote: > I need to issue a bunch of Page.get() requests in

[pywikibot] Re: Line breaking the cite templates

2023-02-27 Thread John
I use mwparserfromhell for template parsing/formatting. On Mon, Feb 27, 2023 at 11:32 AM wrote: > I don’t know what the bot has to fix and I don’t remember for a script > fixing templates. > > There are only a few functions and methods parsing templates and one to > glue the parsing result.

[pywikibot] Re: Text between two comments?

2023-02-02 Thread John
When I was parsing similar text, I did a .split on the header part and parsed the sections On Thu, Feb 2, 2023 at 7:26 PM Roy Smith wrote: > Thanks. > > Sadly, I think treating this as flat text will end up being the most > straight-forward way to do it. > > > > On Feb 2, 2023, at 7:03 PM,

[pywikibot] Re: Next node?

2023-01-01 Thread John
I wouldnt worry about dealing with nodes. I would use something like: wikicode = mwparserfromhell.parse(page_text) templates = wikicode.filter_templates(recursive=True) for template in templates: if re.search(ur'mytemplate',unicode(template.name),re.I): template_text =

[pywikibot] Re: How to analyze block logs?

2022-11-01 Thread John
Nothing currently exists, but should be fairly easy using a log parser and a local database. On Tue, Nov 1, 2022 at 5:39 PM Bináris wrote: > Hi, > > I want to write a script that monitors block logs or the list of active > blocks for a certain reason (open proxy), and warns me if a block

[pywikibot] Re: Adding text in predefined locations

2022-05-04 Thread John
I know there was code for that in the old 1.0 release. Let me dig it up On Wed, May 4, 2022 at 6:23 PM Strainu wrote: > Hello fellow bot writers, > > I have a problem which must have been solve a million times before, > but I can't find a full solution. I need to add sections to a talk > page

[pywikibot] Re: Login with compat

2021-06-02 Thread John
Line 236: self.site._token[index] = data['login']['lgtoken'] + "+\\" change to: try: self.site._token[index] = data['login']['lgtoken'] + "+\\" except: pass On Wed, Jun 2, 2021 at 10:21 AM Bináris wrote: > Is there a manual to

Re: [pywikibot] checking links against SpamFilter

2020-10-24 Thread John
https://en.wikipedia.org/w/api.php?action=help=spamblacklist On Sat, Oct 24, 2020 at 2:29 AM masti wrote: > Hi, > is there a way to check if the link will be catched by SpamFilter > without saving the page? > > I am doing some link statistics and cannot save the results page due to > global

Re: [pywikibot] Using listpages with redirects

2020-10-14 Thread John Bray
l, > > -start parameter does not include redirects. > Unfortunately -redirectonly option wasn’t ported from compat. > > Best > xqt > > > Am 29.08.2020 um 12:42 schrieb John Bray : > > > > The problem gets worse > > > > pwb.py listpages -ns:0 -start

[pywikibot] ImageTransfer script

2020-10-09 Thread John Bray
. Found image: [[File:Happy.jpeg]] Found 1 oldwiki:en-gb processes running, including this one. Found 1 newwiki:en-gb processes running, including this one. WARNING: /home/john/bin/pywikibot/core/scripts/imagetransfer.py:143: Depre

Re: [pywikibot] Using listpages with redirects

2020-08-29 Thread John Bray
t pwb.py replace -page:"David" "#REDIRECT" "@redirect" works pwb.py replace -start "REDIRECT" "@redirect" will ignore the page David if it just contains the # line So whatever pywikibot does for page selection, a #REDIRECT line upsets it On Sat

Re: [pywikibot] Using listpages with redirects

2020-08-29 Thread John Bray
becoming a > comment? Try escaping it. > > Strainu > > Pe marți, 18 august 2020, John Bray a scris: >> >> I'd like to get all the redirect pages out of a wiki, but >> >> pwb.py listpages -start:UK -grep:'#REDIRECT' -format:"{page.title}" -get >>

[pywikibot] Using listpages with redirects

2020-08-18 Thread John Bray
ed Kingdom]] pwb.py listpages -start:UK -grep:'#' -format:"{page.title}" -get picks up pages with a # in them, but not any of the #REDIRECTs why isn't -grep just parsing the page fully? John ___ pywikibot mailing list pywik

Re: [pywikibot] Searching the list archives

2020-06-05 Thread John Bray
Thanks. I've flagged that this search is not well advertised. https://meta.wikimedia.org/wiki/Talk:Mailing_lists#Searching_mailing_list_archives John On Fri, 5 Jun 2020 at 01:23, Federico Leva (Nemo) wrote: > > Use Markmail: > https://markmail.org/search/?q=se

[pywikibot] Searching the list archives

2020-06-04 Thread John Bray
Is there a way to search the list archives at https://lists.wikimedia.org/pipermail/pywikibot/ John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[pywikibot] listpages with -notcategory

2020-06-02 Thread John Bray
s? BTW, I fixed my wikia problem, see https://community.fandom.com/wiki/Thread:1881105 John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[pywikibot] Using on a wkia (fandom.com) site

2020-05-30 Thread John Bray
://hornblower.fandom.com/wiki/Special:BotPasswords does not exist python pwb.py listpages -cat:Captains WARNING: Non-JSON response received from server wikia:wikia; the server may be down. So there is that problem, and I'm not sure how to feed in my password. John

[pywikibot] Instantiaton warning fixed

2020-05-22 Thread John Bray
Changing mylang = 'fancyclopedia' as xqt suggested worked. Thanks for your help ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[pywikibot] Preventing warning instantiated using different code "en"

2020-05-21 Thread John Bray
gs.php has $wgLanguageCode = "en"; Thanks John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[pywikibot] Changing page link text to the target of a redirect

2019-02-19 Thread John Bray
. Bloggs]] but won't do the final step of producing [[Fred Bloggs]] Is there way of doing this in one step, or a way to automatically remove the display text for links? John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https

[pywikibot] Removing unused redirects

2019-01-26 Thread John Bray
? The Special:LonelyPages seems to exclude redirects. I've installed Special:UnusedRedirects, would running delete.py -links Special:UnusedRedirects be the way to go? John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org

Re: [pywikibot] Fixing capitalisation issues when importing from wikidot

2019-01-22 Thread John Bray
. John ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[pywikibot] Fixing capitalisation issues when importing from wikidot

2019-01-10 Thread John Bray
case insensitive, and changes the link to be [[SF Fandom|SF fandom]] Does such a script exist? With so many pages it would have to be automatic, and I could cope if it picked the wrong one of 2 capitalisation choices. John ___ pywikibot mailing list pywikib

Re: [pywikibot] Archivebot fails on abuse filter

2018-06-05 Thread John
Honestly I would leave it as is. The filters that bots should exempt from should be updated on wiki to ignore bots On Tue, Jun 5, 2018 at 1:09 AM Martin Urbanec wrote: > Is abusefilter recoverable? It can even block you without any API-side > notice. Do we want to risk it or let bot operators

Re: [pywikibot] [Wikidata] First experiment of lexicographical data is out

2018-05-23 Thread John Mark Vandenberg
New task https://phabricator.wikimedia.org/T195435 On Thu, May 24, 2018 at 9:38 AM, John Mark Vandenberg <jay...@gmail.com> wrote: > cliff notes: Wikidata has a new entity type which is quite different > from existing entity types. > > https://www.mediawiki.org/wiki/Extens

Re: [pywikibot] Getting code review flowing again

2017-06-05 Thread John Mark Vandenberg
API queries? On Sat, May 27, 2017 at 1:13 AM, John Mark Vandenberg <jay...@gmail.com> wrote: > I would appreciate it if people gave me a few days before abandoning > all my patches. > > I will be rotating back onto pywikibot next week, as I am mentoring a > Pywikibot GSOC pr

Re: [pywikibot] Getting code review flowing again

2017-05-26 Thread John Mark Vandenberg
gt; > ___ > pywikibot mailing list > pywikibot@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/pywikibot -- John Vandenberg ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

Re: [pywikibot] Counting number of times a template parameter is used

2017-02-08 Thread John
I could write something up, but the best way is via categories for param usage On Wed, Feb 8, 2017 at 5:43 PM Jon Harald Søby wrote: > I'm not sure if this is even the right place to post it, but I when > working with templates, especially infobox standardization, I would like

Re: [pywikibot] Local image delinker bot

2016-10-02 Thread John
If you need help mass removing missing file links let me know. AWB has a great plugin for that On Sunday, October 2, 2016, info wrote: > > > I think unlink.py should be able to unlink files. > > Best xqt > > > Am 17.09.2016 um 20:53 schrieb MarcoAurelio

Re: [pywikibot] Cosmetic changes and HTML5

2016-08-16 Thread John Mark Vandenberg
wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/pywikibot > -- John Vandenberg ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

Re: [pywikibot] Regex for chemicals

2016-08-10 Thread John Mark Vandenberg
On Wed, Aug 10, 2016 at 1:26 PM, Bináris <wikipo...@gmail.com> wrote: > > 2016-08-10 8:19 GMT+02:00 John Mark Vandenberg <jay...@gmail.com>: >> >> Does this one suit your purposes: >> >> >> ([αβγδφωλμπ]-)?([([]*[A-Z☐][ub]?[a-z]?[₁₂₃₄₅₆₇₈₉₀]*(\)?[¹²

Re: [pywikibot] [Pywikipedia-announce] Login broken for bots

2016-08-06 Thread John Mark Vandenberg
On Sat, Aug 6, 2016 at 12:58 PM, John Mark Vandenberg <jay...@gmail.com> wrote: > On Sat, Aug 6, 2016 at 4:11 AM, Maarten Dammers <maar...@mdammers.nl> wrote: >> Hi everyone, >> >> A change was deployed which changed the behavior of the login api. > > The of

Re: [pywikibot] [Wikidata-tech] How to make a Wikibase server-installation accessible via Pywikibot local-library?

2016-03-02 Thread John Mark Vandenberg
he wrong context I'm really sorry (I searched > with no success the official pages of Wikibase and the archive of this > mailing-list, http://blog.gmane.org/gmane.org.wikimedia.wikidata.technical): > please let me know whether I should better ask this question to the >

[pywikibot] Fwd: [Wikitech-l] *unclear-"now"-timestamp* (was Re: Bot operators: Please check your configuration)

2016-01-29 Thread John Mark Vandenberg
'Pywikibot' has this problem. The results dont show which version is doing it. -- Forwarded message -- From: "Brad Jorsch (Anomie)" Date: 30 Jan 2016 6:06 am Subject: [Wikitech-l] *unclear-"now"-timestamp* (was Re: Bot operators: Please check your

Re: [pywikibot] about parsing the dump

2016-01-19 Thread John Mark Vandenberg
On Wed, Jan 20, 2016 at 1:06 AM, Aaron Halfaker <aaron.halfa...@gmail.com> wrote: > > On Tue, Jan 19, 2016 at 1:10 AM, John Mark Vandenberg <jay...@gmail.com> > wrote: >> >> On Tue, Jan 19, 2016 at 4:13 PM, Aaron Halfaker >> <aaron.halfa...@gmail.com>

[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
Gerrit-Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43 Gerrit-PatchSet: 5 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: MarcoAurelio <strig...@gmail.com> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com&g

[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change. Change subject: Replacing references from Bugzilla to Phabricator .. Patch Set 4: PS4 is rebase only -- To view, visit https://gerrit.wikimedia.org/r/234734 To unsubscribe

[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change. Change subject: Replacing references from Bugzilla to Phabricator .. Patch Set 4: (1 comment) https://gerrit.wikimedia.org/r/#/c/234734/4/pywikibot/textlib.py File pywikibot

[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change. Change subject: Replacing references from Bugzilla to Phabricator .. Patch Set 1: (8 comments) https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/data/api.py File

[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has restored this change. Change subject: Replacing references from Bugzilla to Phabricator .. Restored I'll polish this up -- To view, visit https://gerrit.wikimedia.org/r/234734 To unsubscribe, visit https

[pywikibot] Pywikibot 2.0rc4 released

2015-12-15 Thread John Mark Vandenberg
ed5d5 nowcommons: Query at most one users -- John Vandenberg ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

[Pywikibot-commits] [Gerrit] WIP: Replacing old Bugzilla tickets with Phab. - change (pywikibot/core)

2015-08-29 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change. Change subject: WIP: Replacing old Bugzilla tickets with Phab. .. Patch Set 1: (5 comments) https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/data/api.py File pywikibot

[pywikibot] GSoC: OAuth Flow now supported by git master

2015-08-26 Thread John Mark Vandenberg
/pywikibot-oauth/ https://phabricator.wikimedia.org/tag/pywikibot-flow/ -- John Vandenberg ___ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot

Re: [pywikibot] Code review

2015-08-12 Thread John Mark Vandenberg
? I have a fairly constant stream of patches that I shouldn't have +1'd as it had a problem that I hadnt noticed. And some of those are my own patches. e.g. https://gerrit.wikimedia.org/r/#/c/229731/ was a particularly careless self +1. -- John Vandenberg

[Pywikibot-commits] [Gerrit] [FIX] url protocol of test.orain.org - change (pywikibot/core)

2015-08-05 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: [FIX] url protocol of test.orain.org .. [FIX] url protocol of test.orain.org Change-Id: I9a187ed7d6fede0ef2594bc33e7210cfe113544c --- M .travis.yml 1

[Pywikibot-commits] [Gerrit] Allow all action=edit optional arguments - change (pywikibot/core)

2015-06-13 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Allow all action=edit optional arguments .. Allow all action=edit optional arguments APISite.editpage prevented some valid uses of action=edit

[Pywikibot-commits] [Gerrit] [FEAT] disambredir: Use replace_links - change (pywikibot/core)

2015-06-12 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: [FEAT] disambredir: Use replace_links .. [FEAT] disambredir: Use replace_links This adds support for replace_links added in 18e6c9b1

[Pywikibot-commits] [Gerrit] Test extras dependencies in setup.py - change (pywikibot/core)

2015-05-29 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Test extras dependencies in setup.py .. Test extras dependencies in setup.py When PYSETUP_TEST_EXTRAS is not enabled, do not install and test

[Pywikibot-commits] [Gerrit] Set executable bits on top level entry points - change (pywikibot/core)

2015-05-04 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Set executable bits on top level entry points .. Set executable bits on top level entry points Add /usr/bin/python shebang while at it. Change-Id

[Pywikibot-commits] [Gerrit] scripts: set executable mode on all scripts - change (pywikibot/core)

2015-04-18 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: scripts: set executable mode on all scripts .. scripts: set executable mode on all scripts In scripts and scripts/maintenance are python scripts

[Pywikibot-commits] [Gerrit] scripts: fix shebang - change (pywikibot/core)

2015-04-18 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: scripts: fix shebang .. scripts: fix shebang redirect.py has a leading space and states_redirect.py miss a leading slash. Change-Id

[Pywikibot-commits] [Gerrit] Disambiguation page name show before alternatives - change (pywikibot/core)

2015-04-18 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Disambiguation page name show before alternatives .. Disambiguation page name show before alternatives When using -start, the script immediately

[Pywikibot-commits] [Gerrit] Add Page.contributors() and .revision_count() - change (pywikibot/core)

2015-03-17 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Add Page.contributors() and .revision_count() .. Add Page.contributors() and .revision_count() deprecates: - Page - contributingUsers

[Pywikibot-commits] [Gerrit] Bump copyright notice in LICENSE to 2015 - change (pywikibot/core)

2015-01-23 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Bump copyright notice in LICENSE to 2015 .. Bump copyright notice in LICENSE to 2015 Not doing this for every file, since the devs agreed to only

[Pywikibot-commits] [Gerrit] Fix page_tests testBasePageConstructor - change (pywikibot/core)

2014-10-26 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Fix page_tests testBasePageConstructor .. Fix page_tests testBasePageConstructor Empty string titles for BasePage raise InvalidTitle during

[Pywikibot-commits] [Gerrit] Bug 72527 - CircularRedirect exception throws another exception - change (pywikibot/core)

2014-10-26 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Bug 72527 - CircularRedirect exception throws another exception .. Bug 72527 - CircularRedirect exception throws another exception CircularRedirect

[Pywikibot-commits] [Gerrit] Add NoCreateError and fix a bug about issubclass - change (pywikibot/core)

2014-10-25 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Add NoCreateError and fix a bug about issubclass .. Add NoCreateError and fix a bug about issubclass With nocreate=True, if page doesn't exist, API

[Pywikibot-commits] [Gerrit] change license of reflinks.py from GPL to MIT - change (pywikibot/core)

2014-10-24 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: change license of reflinks.py from GPL to MIT .. change license of reflinks.py from GPL to MIT per discussion on Pywikipedia-l: http

[Pywikibot-commits] [Gerrit] [FIX] input_choice: get length of list copy - change (pywikibot/core)

2014-10-24 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: [FIX] input_choice: get length of list copy .. [FIX] input_choice: get length of list copy If the parameters have been zipped with Python 3

[Pywikibot-commits] [Gerrit] Allow github forks to run travis nosetests builds - change (pywikibot/core)

2014-08-07 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged. Change subject: Allow github forks to run travis nosetests builds .. Allow github forks to run travis nosetests builds The wiki user 'Pywikibot-test' only works