Hi Bináris,

Thanks - this looks very promising.

I wonder if you could post a copy of your replace2.py, so I can follow the instructions more clearly - I'm a bit confused by a couple of points.

Thanks again!

On Sat, May 1, 2010 at 22:36, Bináris <wikiposta@gmail.com> wrote:
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

_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l




--
Chris Watkins

Appropedia.org - Sharing knowledge to build rich, sustainable lives.

blogs.appropedia.org
community.livejournal.com/appropedia
identi.ca/appropedia
twitter.com/appropedia