开发者

Extract link image from Wikipedia

开发者 https://www.devze.com 2023-01-04 14:28 出处:网络
I have an html page where I put in a text box an animal species. So I would extract from wikipedia an image of it and load in a

I have an html page where I put in a text box an animal species. So I would extract from wikipedia an image of it and load in a

How I 开发者_C百科can do it?

Thanks.


Wikipedia has an API, which you can see here: http://en.wikipedia.org/w/api.php

Documentation: http://www.mediawiki.org/wiki/API

However, since they don't seem to have support for the JSONP format, so you'll need to do the API calls server side. You can do this using cURL (there are wrappers in pretty much every language you would want to use).

Then you would want to send off a call to something like

curl http://en.wikipedia.org/w/api.php?action=query&prop=images&titles=Jaguar&format=xml

0

精彩评论

暂无评论...
验证码 换一张
取 消