2010/4/1 Chris Watkins <chriswaterguy@appropedia.org>
I want to generate a list of matches for a search, but not do anything to the page.


I tell you the trick. This is not my own wisdom, I have learnt it from hu:user:Pasztilla.

For example, you have a user:MyBot/try subpage. You copy replace.py to replace2.py, and then modify as itt follows:

1.  Look for "    def run(self):" line, and write under it:
        list =''
This will start a new list. Alternatively,
        list = wikipedia.Page(wikipedia.getSite(), 'User:MyBot/try').get()
will continue your existing list.

2. Under "                if choice == 'y':"
look for                     page.put_async(new_text, self.editSummary)
and comment it out:                     #page.put_async(new_text, self.editSummary)

and write just below this line:
                    list+= u'# [[%s]]\n' %page.title()
                    listsite = wikipedia.Page(wikipedia.getSite(), 'User:MyBot/try')
                    listsite.put(list, self.editSummary)
This will write the title of the page to your subpage.

3. Under the "            if self.acceptall and new_text != original_text:" line
make the same changes as in step 2.

Enjoy!
 

--
Bináris