directly write to database

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

directly write to database

Liz Kim
Hello,
I have over 200 .html files that need to be turned into wiki.
These are all very simple text html files with maybe <b> tags and <p>.. very
simple.
Instead of copying and pasting all these files one by one, is there a way to
access the database to write to it directly?
Is there a way to easily understand the db strucutre?
I am thinking there could be a script that can read the html code and i can
easily parse out what I want to put into teh edit window of wiki..
Thank you, Liz
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: directly write to database

Tim Doyle-2
I know of two options:

1. (suggested by Brion Vibber) use the ImportDump maintenance program:

php maintenance/importDump.php big-old-file.xml

-or-

for x in *.xml
do
  php maintenance/importDump.php $x
done


2. Use the Pywikipediabot Framework:

a. Install the pywikipediabot and configure it for your site.

b. Manipulate the data for your pages into one large file, preferrably named
dict.txt with {{start}} tags at the top of each page, {{stop}} tags at the
bottom, and the '''pagename''' as the first bolded item on each page
(optionally enclosed in an HTML-style <!-- comment -->

c. Run the login.py script to log in.

d. Run the pagefromfile.py script. This will parse through the dict.txt file
quickly creating each page in the file on your wiki.

This should be a fairly quick process... complete in under an hour or two.
The pagefromfile.py script can occasionally bomb out. If that happens, look
at your wiki recentchanges log, note the last file uploaded, remove the data
in dict.txt from the top of the file to that page, and restart.

Good luck!

Tim


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Liz Kim
Sent: Wednesday, September 06, 2006 3:19 PM
To: [hidden email]
Subject: [Wikitech-l] directly write to database


Hello,
I have over 200 .html files that need to be turned into wiki. These are all
very simple text html files with maybe <b> tags and <p>.. very simple.
Instead of copying and pasting all these files one by one, is there a way to
access the database to write to it directly? Is there a way to easily
understand the db strucutre? I am thinking there could be a script that can
read the html code and i can easily parse out what I want to put into teh
edit window of wiki.. Thank you, Liz
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: directly write to database

Ron Hall
In reply to this post by Liz Kim


On a related note - If I have a "skeleton" that lives in the wiki now
and is built with many different templates
is there a way for me to add more documents of this type easily to the
wiki? Now I'm sure I can generate
raw wiki text without too much trouble and even give them all unique
names  - would the methods outlined in a later response also work?

r


_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l