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

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

问题描述

过去 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天全站免登陆