On Mon, Sep 8, 2014 at 10:45 AM, Wiki Billinghurst
<billinghurstwiki(a)gmail.com> wrote:
For English Wikisource, I have a series of 63 volumes
of the "Dictionary of
National Biography" that have now been transcribed. ...
I am trying work out how to use pywikibot to generate a list of the pages
with red links.
I am guessing that "John <phoenixoverride(a)gmail.com>" might be
offering to run a database query to provide the data you need, which
would obtain the data quite quickly, but here is a introductory
approach to obtaining the data using pywikibot 'core'.
$ python pwb.py shell
>> import pywikibot
>> site = pywikibot.Site('en', 'wikisource')
>> from pywikibot import pagegenerators
>> gen = pagegenerators.PrefixingPageGenerator(namespace=104,
prefix='Dictionary_of_National_Biography', site=site)
>> for dnb_page in gen:
>> for linked_page in dnb_page.linkedPages():
>> if not linked_page.exists():
>> pywikibot.output(u"%s refers to missing %s" % (dnb_page,
linked_page))
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/124]] refers to missing
[[wikisource:en:Bickerseth, Edward Henry (DNB02)]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/124]] refers to missing
[[wikisource:en:Temple, Frederick (DNB02)]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/124]] refers to missing
[[wikisource:en:Westcott, Brooke Foss (DNB02)]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/188]] refers to missing
[[wikisource:en:Chinese Picture: notes on photographs made in China]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/37]] refers to missing
[[wikisource:en:Modern Philosophy (Adamson)]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/460]] refers to missing
[[wikisource:en:Handbook to Spain]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/460]] refers to missing
[[wikisource:en:Portugal Old and New]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/460]] refers to missing
[[wikisource:en:Round the Calendar in Portugal]]
[[wikisource:en:Page:Dictionary of National Biography, Second
Supplement, volume 1.djvu/460]] refers to missing
[[wikisource:en:Travels in Portugal]]
...
You may need to add more logic to filter which 'linked_page' you are
interested in, such as only some titles or namespaces.
--
John Vandenberg