https://bugzilla.wikimedia.org/show_bug.cgi?id=17554
--- Comment #3 from Alex Z. <[email protected]> 2009-02-21 18:42:17 UTC --- (In reply to comment #2) > Hmmm. I don't see why this is "modifying aspects of the page history." It's > just importing a new, current version at the current time, not in the past. Export/Import is designed for copying the history or content of a page from one wiki to another. AFAIK, Import isn't designed so that people can download the XML docuument, then re-upload it. > If the MediaWiki API can do this simply, that's great. Where can I see a > complete example that does search-and-replace in general? ("In general" > meaning "you don't have to write a new PHP script for every search/replace > operation.") Somehow I wonder, if it were this simple, wouldn't someone > already have written a search-and-replace Special Page? Something like <http://www.mediawiki.org/wiki/Extension:Replace_Text>? It doesn't support regex yet, but it does seem to be maintained at least. I don't know of any premade PHP scripts, but I know Pywikipedia has one and writing a simple one shouldn't be too difficult. 1. Define the search expression and replace text 2. Load the list of page to edit from a text file or something 3. Login to the site with action=login 4. Get the pagetext for each from prop=revisions 5. Perform the replacements 6. Save the pages with action=edit > Also, I think the import solution is better than an API solution in one > respect: you can see and validate your changes (in the XML file) before > import. > With the API, if you get your search-and-replace patterns wrong (which is > VERY > easy to do), you've modified your content wrongly. I find that more "scary" > than modifying an XML file you can check in advance. > If this is that much of a concern, add "save the text to a file or run through action=parse and load in a browser and wait for user input" before saving in the above steps. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
