我一直在网上搜索,但我似乎找不到任何使用WikiNews数据的例子。他们有一个RSS提要,链接到HTML的各个故事,但我想以XML等结构化格式获取数据。
结构化格式是指每个故事的XML文件,它具有已定义的XML架构(XSD)文件。请参阅:[http://www.w3schools.com/schema/schema_intro.asp][2]
有没有人写过一个消费来自WikiNews的故事的节目?他们有记录的API吗?
我想使用C#收集选定的故事并将它们存储在SQL Server 2008中。
[2]:“结构化格式”是指XML模式(XSD)文件。请参阅:http://www.w3schools.com/schema/schema_intro.asp
答案 0 :(得分:3)
他们使用的软件has an API但我不确定WikiNews是否支持它。
答案 1 :(得分:0)
他们的Feed:http://feeds.feedburner.com/WikinewsLatestNews
如果你把它放在浏览器中并阅读源代码,你会发现它是XML。 XML包含标题,描述,链接等。只有描述是HTML格式。
以下是回复的开始:
<rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>Wikinews</title>
<description>Wikinews RSS feed</description>
<language>en</language>
<link>http://en.wikinews.org</link>
<copyright>Creative Commons Attribution 2.5 (unless otherwise noted)</copyright>
<generator>Wikinews Fetch</generator>
<ttl>180</ttl>
<docs>http://none</docs>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/WikinewsLatestNews" /><feedburner:info uri="wikinewslatestnews" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
<title>Lufthansa pilots begin strike</title>
<link>http://feedproxy.google.com/~r/WikinewsLatestNews/~3/1K2xloPGlmI/Lufthansa_pilots_begin_strike</link>
<description><p><a href="http://en.wikinews.org/w/index.php?title=File:LocationGermany.png&filetimestamp=20060604120306" class="image" title="A map showing the location of Germany"><img alt="A map showing the location of Germany" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/de/LocationGermany.png/196px-LocationGermany.png" width="196" height="90" /></a></p>
<p><b class="published"><span id="publishDate" class="value-title" title="2010-02-22"></span>Monday, February 22, 2010</b></p>
<p>The pilot's union of <a href="http://en.wikinews.org/wiki/Germany" title="Germany" class="mw-redirect">German</a> airline <a href="http://en.wikipedia.org/wiki/Lufthansa" class="extiw" title="w:Lufthansa">Lufthansa</a> have begun a four-day strike over pay and job security. Operations at subsidiary airlines <a href="http://en.wikipedia.org/wiki/Lufthansa_Cargo" class="extiw" title="w:Lufthansa Cargo">Lufthansa Cargo</a> and <a href="http://en.wikipedia.org/wiki/Germanwings" class="extiw" title="w:Germanwings">Germanwings</a> are also affected by the strike.</p>
<em><a href='http://en.wikinews.org/wiki/Lufthansa_pilots_begin_strike'>More...</a></em><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WikinewsLatestNews?a=1K2xloPGlmI:9SJI0YV04-M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WikinewsLatestNews?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WikinewsLatestNews?a=1K2xloPGlmI:9SJI0YV04-M:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/WikinewsLatestNews?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WikinewsLatestNews?a=1K2xloPGlmI:9SJI0YV04-M:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/WikinewsLatestNews?d=YwkR-u9nhCs" border="0"></img></a>
</div></description>
<guid isPermaLink="false">http://en.wikinews.org/wiki/Lufthansa_pilots_begin_strike</guid>
<feedburner:origLink>http://en.wikinews.org/wiki/Lufthansa_pilots_begin_strike</feedburner:origLink></item>
答案 2 :(得分:0)