wikipedia

  • Thread starter Thread starter Pitaridis Aristotelis
  • Start date Start date
There is a free encyclopedia called wikipedia
(http://wikimediafoundation.org/). Does anyone knows how to use it in
order to get various articles for diplaying them in my application?


If you have .NET 2.0, you can use the web browser control to fetch web
pages.

In .NET 1.1 you'll have to use a wrapper class to access web pages.

Wikipedia also provides content in XML files ... so you could render the
content using the XML files too.
 
Both ways are very interesting. Where can I find information about this,
especially for the XML way???
 
I found a way to get the xml result, but I have no idea about xml. Can
someone write a function which will get only the text which contains the
article?
Thanks
 
I found a way to get the xml result, but I have no idea about xml. Can
someone write a function which will get only the text which contains the
article?
Thanks


Yes. Take a look at System.XML namespace.
 
I have used the following code but it does not work

Doc.Load("http://en.wikipedia.org/wiki/Special:Export/test")
If Doc.SelectNodes("/mediawiki/page/revision/text").Count > 0 Then
Dim output As String =
Doc.SelectNodes("/mediawiki/page/revision/text").Item(0).InnerText
End If

The structure of the xml file is like this

<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.3/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.3.xsd"
version="0.3" xml:lang="en">
<siteinfo>
<sitename>Wikipedia</sitename>
<base>http://en.wikipedia.org/wiki/Main_Page</base>
<generator>MediaWiki 1.9alpha</generator>
<case>first-letter</case>
<namespaces>
<namespace key="-2">Media</namespace>
<namespace key="-1">Special</namespace>
<namespace key="0" />
<namespace key="1">Talk</namespace>
<namespace key="2">User</namespace>
<namespace key="3">User talk</namespace>
<namespace key="4">Wikipedia</namespace>
<namespace key="5">Wikipedia talk</namespace>
<namespace key="6">Image</namespace>
<namespace key="7">Image talk</namespace>
<namespace key="8">MediaWiki</namespace>
<namespace key="9">MediaWiki talk</namespace>
<namespace key="10">Template</namespace>
<namespace key="11">Template talk</namespace>
<namespace key="12">Help</namespace>
<namespace key="13">Help talk</namespace>
<namespace key="14">Category</namespace>
<namespace key="15">Category talk</namespace>
<namespace key="100">Portal</namespace>
<namespace key="101">Portal talk</namespace>
</namespaces>
</siteinfo>
<page>
<title>Play</title>
<id>22962</id>
<revision>
<id>79448292</id>
<timestamp>2006-10-04T13:00:19Z</timestamp>
<contributor>
<username>JonHarder</username>
<id>629503</id>
</contributor>
<comment>revert: not seeing why this article should be exempt from citing
sources.</comment>
<text xml:space="preserve">XXXXXX this is the part that I want to get
XXXXXX</text>
</revision>
</page>
</mediawiki>
 
Back
Top