Wikipedia as part of my iOS app

2019-06-14 07:12发布

I would like to download information from wikipedia to my iOS app. Firstly, I created simple RSS reader, but I can't download date from wiki. Now, I think that I should create parser for wiki.

What do you think about this? Any ideas?

Thanks, Tomek

3条回答
干净又极端
2楼-- · 2019-06-14 07:18

In my opinion, parsing a website is never a good idea. Only the smallest change in the design of the website can break your application and make it unusable. I'd try to get to your data in an alternative way. ;-)

Sandro Meier

查看更多
闹够了就滚
3楼-- · 2019-06-14 07:38

Scrapping a web site directly from your app is never a good idea. If you are ever going to do that it is suggested that you do it on a server and provide the data to your app in a well known format, so that site changes can be quickly managed by your server, and as a result, never breaking your app.

Although wikipedia does not have a formal API, it provides some other ways of extracting data from its servers. You should check this link:

http://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot#APIs%5Ffor%5Fbots

查看更多
别忘想泡老子
4楼-- · 2019-06-14 07:40

I know this question is quite old. But I've dealt with the same problem and wrote this very small library. I am using the mediawiki api (Mentioned in the post from Felipe) to get the needed information.

https://github.com/prine/WikiApiObjectiveC

查看更多
登录 后发表回答