android Wikipedia api game

前端 未结 1 1226
无人及你
无人及你 2020-12-20 08:50

Hi i have to make an app with the following requirement:

When the user opens the app, it displays the text from a random Wikipedia page. 
(You’re free to use         


        
相关标签:
1条回答
  • 2020-12-20 09:08

    There are two things I notice in your query. First, the exintro means you only get sentences from over the first heading. Only a few articles have ten sentences before that. Second, you are getting results from all namespaces. By using grnnamespace=0 you will only get articles. So something like this might work for you:

    https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&generator=random&exsentences=10&grnnamespace=0

    0 讨论(0)
提交回复
热议问题