检索维基百科文章的第一段 [英] Retrieve first paragraph of Wikipedia article

查看:118
本文介绍了检索维基百科文章的第一段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图理解在过去2天链接到MediaWiki文档和我无法弄清楚如何通过MediaWiki的API获取维基百科文章的第一段。

I've been trying to understand the MediaWiki documentation for the past 2 days and I can't figure out how to retrieve the first paragraph of a Wikipedia article through the MediaWiki API.

可能有人点我的方向是正确的?

Could someone point me to the right direction?

我要呼吁的file_get_contents,但我相信有一个干净的解决方案。

I am about to appeal to file_get_contents, but I'm confident there's a "cleaner" solution.

推荐答案

不要尝试使用原始的API,而不是使用客户端包装。这里有一个长长的清单以供选择,全部为PHP:

Don't try to use the raw API, instead use a client wrapper. Here's a long list to choose from, all for PHP:

http://en.wikipedia.org/wiki/Wikipedia:PHP_bot_framework_table

这篇关于检索维基百科文章的第一段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆