On Wed, 5 Jan 2005 13:50:38 -0700, Jot Powers <misc(a)bofh.com> wrote:
I've looked around checked the FAQ, Googled, and
this is the
closest I've seen to a question I have. Is there an easy way
(ie programatically) to import a lot of information INTO a wiki
from another source? I promise to document the answer in the metawiki. :)
Well, there's two ways, basically:
1) using pywikipediabot (or a bot you write from scratch) to "pretend
to be a user" - i.e. access "...&action=edit" pages, fill in the
contents you want to be there, and submit the form back.
2) using some *server-side* scripts to push the data into the database
directly. Basically (in 1.3.x), you need to create each page as an
entry in the 'cur' table, but for things to behave properly you need
to observe the other things the "normal" page editing code does - off
the top of my head, that includes moving links *to* a new page from
'brokenlinks' to 'links' (so they don't appear as redlinks any more)
and checking the new text for links *from* the page, to correct the
various links tables (e.g. for "What links here" listings)(that's one
of the jobs of Parser::preSaveTransform() I think).
In short, for the moment at least, running a bot is probably the only
sane way to do it. (Be sure to run it under a user with the 'bot'
user_rights flag, so the flood can be hidden from RecentChanges - see
http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki)
--
Rowan Collins BSc
[IMSoP]