tags:

views:

72

answers:

2

I am writing an extension for Mediawiki. If I know the page_id and page_title of an article, how do I get the first 50 odd words of the article? Is there a function defined to get the article text give the page_id?

+2  A: 

Something like:

$article = new Article( Title::newFromText( 'Main_Page' ) ) ;
echo $article->getContent();

Grabbing just the first 50 words is left as an exercise for the reader.

Joshua C. Lerner
Hey thanks Joshua :) Can you please point me to a link which documents these classes and methods because I have been unable to find any source of information on such crucial functionality anywhere!
Crimson
+1  A: 

If anyone is looking for more documentation, refer to:

http://svn.wikimedia.org/doc/

Crimson