Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

Add record to database

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


qli at ica

Oct 20, 2009, 7:01 AM

Post #1 of 13 (1730 views)
Permalink
Add record to database

Hi,
I have already got the article data from the wikipedia and I stored it
on my computer .Now I want to add the article to the local wiki. I have
done a lot of reaserches and I know that there are a lot of things to do.
If add a record to the page table ,then the
revision,recentchange,text,pagelink table and so on will be changed.So I
think maybe there is a easy way to do that .

Can you tell me what should I do ? Should I simply use
'insert,update,select...'words?

Sincerely looking froward you help, thanks

vanessa lee
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


questpc at rambler

Oct 20, 2009, 8:57 AM

Post #2 of 13 (1678 views)
Permalink
Re: Add record to database [In reply to]

* 李琴 <qli [at] ica> [Tue, 20 Oct 2009 22:01:00 +0800]:
>
> Hi,
> I have already got the article data from the wikipedia and I
stored
> it
> on my computer .Now I want to add the article to the local wiki. I
> have
> done a lot of reaserches and I know that there are a lot of things to
> do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So
I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
It is much better to use corresponding PHP class layer rather than
modify the database directly, because the DB scheme may change in the
future.
Look at the method doEdit() located in 'includes/Article.php'
Dmitriy

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Oct 20, 2009, 3:18 PM

Post #3 of 13 (1679 views)
Permalink
Re: Add record to database [In reply to]

李琴 wrote:
> Hi,
> I have already got the article data from the wikipedia and I stored it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee


If you're working inside mediawiki php.

$wgTitle = Title::newFromText( "MyArticle" );
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "Some text", '', false, false );


If you don't want to work with php, use maintenance/importTextFile.php


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Oct 20, 2009, 3:29 PM

Post #4 of 13 (1676 views)
Permalink
Re: Add record to database [In reply to]

2009/10/21 Platonides <Platonides [at] gmail>:
> If you're working inside mediawiki php.
>
> $wgTitle = Title::newFromText( "MyArticle" );
> $wgArticle = new Article( $wgTitle );
> $wgArticle->insertNewArticle( "Some text", '', false, false );
>
>
> If you don't want to work with php, use maintenance/importTextFile.php
>
Please use other variable names than $wgTitle and $wgArticle to reduce
confusion with the global variables by the same name.

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


liangent at gmail

Oct 21, 2009, 3:04 AM

Post #5 of 13 (1675 views)
Permalink
Re: Add record to database [In reply to]

what's the format of article data, xml dump or just plain text?

On Tue, Oct 20, 2009 at 10:01 PM, 李琴 <qli [at] ica> wrote:

>
> Hi,
> I have already got the article data from the wikipedia and I stored it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Oct 21, 2009, 6:49 AM

Post #6 of 13 (1662 views)
Permalink
Re: Add record to database [In reply to]

Liangent wrote:
> what's the format of article data, xml dump or just plain text?

Plain text.
There are other tools for importing from xml format.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 26, 2009, 7:05 AM

Post #7 of 13 (1601 views)
Permalink
Re: Add record to database [In reply to]

I used the RSS to get the page from the internet and I put it in MySql
database.



-----Original Message-----
From: Liangent <liangent [at] gmail>
To: Wikimedia developers <wikitech-l [at] lists>
Date: Wed, 21 Oct 2009 18:04:15 +0800
Subject: Re: [Wikitech-l] Add record to database


what's the format of article data, xml dump or just plain text?

On Tue, Oct 20, 2009 at 10:01 PM, 李琴 <qli [at] ica> wrote:

>
> Hi,
> I have already got the article data from the wikipedia and I stored it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 26, 2009, 7:18 AM

Post #8 of 13 (1609 views)
Permalink
Re: Add record to database [In reply to]

I'm working inside mediawiki php,but I just beginning. Can you tell me when
I finished editing a article and clicked the save button,which variable
takes the content of the edit box?
Or which function handles the rawText?

Thanks
vanessa lee


-----Original Message-----
From: Platonides <Platonides [at] gmail>
To: wikitech-l [at] lists
Date: Wed, 21 Oct 2009 00:18:47 +0200
Subject: Re: [Wikitech-l] Add record to database


李琴 wrote:
> Hi,
> I have already got the article data from the wikipedia and I stored
it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee


If you're working inside mediawiki php.

$wgTitle = Title::newFromText( "MyArticle" );
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "Some text", '', false, false );


If you don't want to work with php, use maintenance/importTextFile.php


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Oct 26, 2009, 8:42 AM

Post #9 of 13 (1608 views)
Permalink
Re: Add record to database [In reply to]

2009/10/26 李琴 <qli [at] ica>:
> I'm working inside mediawiki php,but I just beginning. Can you tell me when
> I finished editing a article and  clicked the save button,which variable
> takes the content of the edit box?
> Or which function handles the rawText?
>
It's in $wgRequest->getVal('wpTextbox1'); I'm not sure you want to be
messing with EditPage's internals, though, because even most MediaWiki
developers think EditPage is scary.

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 31, 2009, 12:55 AM

Post #10 of 13 (1534 views)
Permalink
Re: Add record to database [In reply to]

Hi,
I setup a Zh-wiki .

And now I have tried to use '$wgTitle = Title::newFromText( "MyArticle"
);
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "$text", '', false, false ); //$text
contains the rawText fo the new articl'

to add a article to local wiki.But wiki can't recognize the Chinese.The
display of this articl are garbled.

Can you tell me why is there such a problem?

Thanks a lot.

vanessa lee







李琴 wrote:
> Hi,
> I have already got the article data from the wikipedia and I stored
it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee


If you're working inside mediawiki php.

$wgTitle = Title::newFromText( "MyArticle" );
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "Some text", '', false, false );


If you don't want to work with php, use maintenance/importTextFile.php


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Nov 1, 2009, 6:34 AM

Post #11 of 13 (1494 views)
Permalink
Re: Add record to database [In reply to]

李琴 wrote:
> Hi,
> I setup a Zh-wiki .
>
> And now I have tried to use '$wgTitle = Title::newFromText( "MyArticle"
> );
> $wgArticle = new Article( $wgTitle );
> $wgArticle->insertNewArticle( "$text", '', false, false ); //$text
> contains the rawText fo the new articl'
>
> to add a article to local wiki.But wiki can't recognize the Chinese.The
> display of this articl are garbled.
>
> Can you tell me why is there such a problem?
>
> Thanks a lot.
>
> vanessa lee


What do you mean with 'wiki can't recognize the Chinese'? The contents
of $text aren't being properly rendered at the wiki?
Check that its contents are in utf-8.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Nov 29, 2009, 7:21 AM

Post #12 of 13 (1097 views)
Permalink
Re: Add record to database [In reply to]

hi,
I use
$wgTitle = Title::newFromText( "MyArticle" );
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "Some text", '', false, false );

to add new articles to WIKI database,and use updateArticle() to update the
articles.

But when I use those two fuctions,and implement the program contains them.

The page always redirect to the new article page or the updated article page
immediately .

How to solve this problem ?I don't want to let the page jump.

Thanks very much!

vanessa lee


-----Original Message-----
From: Platonides <Platonides [at] gmail>
To: wikitech-l [at] lists
Date: Wed, 21 Oct 2009 00:18:47 +0200
Subject: Re: [Wikitech-l] Add record to database


李琴 wrote:
> Hi,
> I have already got the article data from the wikipedia and I stored
it
> on my computer .Now I want to add the article to the local wiki. I have
> done a lot of reaserches and I know that there are a lot of things to do.
> If add a record to the page table ,then the
> revision,recentchange,text,pagelink table and so on will be changed.So I
> think maybe there is a easy way to do that .
>
> Can you tell me what should I do ? Should I simply use
> 'insert,update,select...'words?
>
> Sincerely looking froward you help, thanks
>
> vanessa lee


If you're working inside mediawiki php.

$wgTitle = Title::newFromText( "MyArticle" );
$wgArticle = new Article( $wgTitle );
$wgArticle->insertNewArticle( "Some text", '', false, false );


If you don't want to work with php, use maintenance/importTextFile.php


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Nov 29, 2009, 3:09 PM

Post #13 of 13 (1085 views)
Permalink
Re: Add record to database [In reply to]

李琴 wrote:
> hi,
> I use
> $wgTitle = Title::newFromText( "MyArticle" );
> $wgArticle = new Article( $wgTitle );
> $wgArticle->insertNewArticle( "Some text", '', false, false );
>
> to add new articles to WIKI database,and use updateArticle() to update the
> articles.
>
> But when I use those two fuctions,and implement the program contains them.
>
> The page always redirect to the new article page or the updated article page
> immediately .
>
> How to solve this problem ?I don't want to let the page jump.
>
> Thanks very much!
>
> vanessa lee

If it's a program, why are you concerned with "jumping"?
Are you running it at the command line or does it have some kind of web
interface?
How many pages are saved by your program on each batch?


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.