May 09, 2006
Wikipedia API にチャレンジ
Wikipedia の API が無いものかと調べてみた。 「クローラのアクセスは止めて」と書いてあるものの普通に公開されていた。
- Wikipedia:Database download
- http://en.wikipedia.org/wiki/Wikipedia:Download#XML_schema
- XML access
- http://en.wikipedia.org/wiki/Special:Export/Title_of_the_article
- RSS access
- http://www.blinkbits.com/en_wikifeeds_rss/Title_of_the_article
XML フォーマットで記事を取得
AIBO に関する記事を XML フォーマットで取得してみた。 http://en.wikipedia.org/wiki/Special:Export/AIBO にアクセスするだけで良い。
<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/
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.7alpha</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>AIBO</title>
<id>47087</id>
<revision>
<id>51895470</id>
<timestamp>2006-05-06T22:55:18Z</timestamp>
<contributor>
<ip>68.121.102.200</ip>
</contributor>
<comment>/* External links */</comment>
<text xml:space="preserve">[[Image:AIBO.JPG|thumb|right|The AIBO ERS-7 re
sembles a small dog]] '''AIBO''' is one of several types of [[robot|robotic]] [
[pet]]s designed and manufactured by [[Sony]]; there have been sever
中略
</text>
</revision>
</page>
</mediawiki>
RSS フォーマットで記事を取得
同じく、AIBO に関する記事を RSS フォーマットで取得してみた。 http://www.blinkbits.com/en_wikifeeds_rss/AIBO にアクセスするだけで良い。
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:annotate="http://purl.org/rss/1.0/modules/annotate/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<channel>
<title>AIBO RSS Feed for Wikipedia powered by BlinkBits.com</title>
<link>http://www.blinkbits.com/en_wikifeeds/AIBO</link>
<description>Imagine the Collective Wisdom of All Mankind Available in the
Blink of An Eye... That's BlinkBits!</description>
<managingEditor>lcotter@blinkbits.com</managingEditor>
<docs>http://www.blinkbits.com</docs>
<generator>RSS Feed 2.1.4</generator>
<language>en</language>
<lastBuildDate>Wed, 12 Apr 2006 08:09:19 -0400</lastBuildDate>
<image>
<url>http://www.blinkbits.com/images/icon_6040.gif</url>
<title>AIBO RSS Feed from Wikipedia Powered by BlinkBits.com</title>
<link>http://www.blinkbits.com</link>
<width>60</width>
<height>40</height>
</image>
<item>
<title>AIBO Wikipedia RSS Feed</title>
<link>http://www.blinkbits.com/en_wikifeeds/AIBO</link>
<pubDate>Wed, 12 Apr 2006 08:09:19 -0400</pubDate>
<guid isPermaLink="true">http://www.blinkbits.com/en_wikifeeds/AIBO</guid>
<description>
<![CDATA[ [b]AIBO[/b] is one of several types of robotic pets designed and ma
nufactured by Sony; there have been several different models since their introdu
中略
]]>
The Wikipedia article is licensed under http://www.gnu.org/copyleft/fdl.html and
uses material from http://en.wikipedia.org/wiki/AIBO. A preview of this article
is available at http://www.blinkbits.com/en_wikifeeds/AIBO.
</description>
<dc:subject>Biography</dc:subject>
<comments>http://www.blinkbits.com/en_wikifeeds/AIBO</comments>
</item>
</channel>
</rss>
TrackBack ping me at
http://www.in-vitro.jp/blog/index.cgi/WebService/20060509_01.trackback
writeback message: Ready to post a comment.
