Thanks Merlijn,
Not sure if it's an effective way to search those pages, but what you need
is a new script that does something like (not tested, but to give an idea)
import wikipedia, pagegenerators for page in pagegenerators.allpagesgenerator(): if '{|' in page.get(): print page.title
Please remember this is very slow and bandwidth-consuming. Running this on an XML dump seems like a better way. Would it be problematic to have slightly outdated information?
That's fine - actually, I'd definitely do it on a dump.
I'm not a coder, and not sure how I'd adapt this code to use with the xml dump. But I copied it into a file and call it "searchtest.py" to try it out, and got this error message:
$ python searchtest.py Checked for running processes. 1 processes currently running, including the current process. Traceback (most recent call last): File "searchtest.py", line 2, in <module> for page in pagegenerators.allpagesgenerator(): AttributeError: 'module' object has no attribute 'allpagesgenerator'
Any suggestions? Sorry I'm not doing much to help - I only ever learnt a little Fortran and C, 18+ years ago, and hacked a little Visual Basic a few years back.
Thanks again, Chris
Best regards, Merlijn van Deen
On Fri, July 24, 2009 9:31 pm, Chris Watkins wrote:
Hi,
I want to list all pages in our wiki that use tables. This seems like it should be simple, but I'm not sure how to do it. Any ideas?
I know that "{|" (the beginning of a table) works as a search term, as I tried it with replace.py. However, I don't want to replace anything, and
I
don't want to sit there pressing "n" for each result.
Ideally I could capture just the names of the pages, without extended details (such as a proposed diff given by replace.py).
Any help much appreciated. Cheers -- Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
identi.ca/appropedia / twitter.com/appropedia blogs.appropedia.org
I like this: five.sentenc.es _______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l