The Artima Developer Community
Sponsored Link

Python Buzz Forum
Deleting lots of pages in a UseMod wiki

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
Deleting lots of pages in a UseMod wiki Posted: Dec 26, 2004 9:06 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: Deleting lots of pages in a UseMod wiki
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement

Someone just created a bunch of spam pages in the Topic Exchange's wiki, with names like these:

# (diff) Table Of Contents 1:40 am . . . . . 221.148.110.xxx
# (diff) Avoiding Memory Leaks 1:40 am . . . . . 221.148.110.xxx
# (diff) fuelhose 1:40 am . . . . . 221.148.110.xxx
# (diff) fbbja 1:40 am . . . . . 221.148.110.xxx
# (diff) www 1:40 am . . . . . 221.148.110.xxx
# (diff) WxWizard 1:40 am . . . . . 221.148.110.xxx
# (diff) Using XML With WxWidgets 1:40 am . . . . . 221.148.110.xxx
# (diff) WxWidgets Vacancies 1:40 am . . . . . 221.148.110.xxx

I started marking them all as DeletedPage, one by one, until I found out about the 'editlinks' command. If you are logged in as an administrator on your wiki, go to the 'Preferences' page, and replace 'editprefs' in the URL with 'editlinks'. You'll get a textarea that will accept various commands to delete and rename pages, in bulk. For example:

!Table Of Contents
!Avoiding Memory Leaks

will delete the first two spam pages in the list above.

So:

python
import re
x = '''# (diff) Table Of Contents 1:40 am . . . . . 221.148.110.xxx
# (diff) Avoiding Memory Leaks 1:40 am . . . . . 221.148.110.xxx
# (diff) fuelhose 1:40 am . . . . . 221.148.110.xxx
# (diff) fbbja 1:40 am . . . . . 221.148.110.xxx
# (diff) www 1:40 am . . . . . 221.148.110.xxx
# (diff) WxWizard 1:40 am . . . . . 221.148.110.xxx
# (diff) Using XML With WxWidgets 1:40 am . . . . . 221.148.110.xxx
# (diff) WxWidgets Vacancies 1:40 am . . . . . 221.148.110.xxx'''
for z in re.findall(r"diff. (.*?) \d\:\d\d .m", x): print "!%s" % z

will dump out a list of delete commands for editlinks. Very handy. Dangerous, though: if there were any non-spam edits in the RecentChanges list, the pages will be deleted (permanently) too, so take care!

Comment

Read: Deleting lots of pages in a UseMod wiki

Topic: pycron Previous Topic   Next Topic Topic: Suspicious

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use