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 11 (604 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


questpc at rambler

Oct 20, 2009, 8:57 AM

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

* 李琴 <qli[at]ica.stc.sh.cn> [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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Oct 20, 2009, 3:18 PM

Post #3 of 11 (568 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Oct 20, 2009, 3:29 PM

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

2009/10/21 Platonides <Platonides[at]gmail.com>:
> 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


liangent at gmail

Oct 21, 2009, 3:04 AM

Post #5 of 11 (565 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.stc.sh.cn> 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.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Oct 21, 2009, 6:49 AM

Post #6 of 11 (566 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 26, 2009, 7:05 AM

Post #7 of 11 (500 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.com>
To: Wikimedia developers <wikitech-l[at]lists.wikimedia.org>
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.stc.sh.cn> 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.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 26, 2009, 7:18 AM

Post #8 of 11 (499 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.com>
To: wikitech-l[at]lists.wikimedia.org
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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Oct 26, 2009, 8:42 AM

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

2009/10/26 李琴 <qli[at]ica.stc.sh.cn>:
> 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Oct 31, 2009, 12:55 AM

Post #10 of 11 (430 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Nov 1, 2009, 6:34 AM

Post #11 of 11 (389 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.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

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


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.