Anyone wanting a list of redirects to work on with pywikibot could do this kludge
curl 'http:/wiki/index.php?title=Special:ListRedirects&limit=5000&offset=0' | grep mw-redirect temp | sed -Ee s'`.*">([^<]*)</a>.*.*">([^<]*)</a>.*`\1`'
On Sat, 29 Aug 2020 at 12:27, info@gno.de wrote:
Hi all,
-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 johnbray822@gmail.com:
The problem gets worse
pwb.py listpages -ns:0 -start -grep:"REDIRECT" -format:"{page.title}"
won't spot files with #REDIRECT, and
pwb.py listpages -ns:0 -start -format:"{page.title}"
won't list pages with just a #DIRECT line, though it will if they have extra text
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, 29 Aug 2020 at 10:31, John Bray johnbray822@gmail.com wrote:
Escaping the # makes no difference
pwb.py listpages -ns:0 -start -grep:"#[Rr]" -format:"{page.title}"
only returns pages with # in the body of URLs
On Wed, 19 Aug 2020 at 10:48, Strainu strainu10@gmail.com wrote:
'#' is special in python, maybe the regex gets post-processed into becoming a comment? Try escaping it.
Strainu
Pe marți, 18 august 2020, John Bray johnbray822@gmail.com 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
produces nothing, but
pwb.py listpages -start:UK -grep:'United Kingdom' -format:"{page.title}" -get
produces, as expected
UK #REDIRECT [[United 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 pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot