Wikipedia API: search for famous people

前端 未结 4 1531
醉话见心
醉话见心 2021-02-20 01:41

I have the following Wikipedia API search query:

http://en.wikipedia.org/w/api.php?&action=query&generator=search&gsrnamespace=0&gsrlimit=20&prop=pag

4条回答
  •  Happy的楠姐
    2021-02-20 02:33

    I think all persons will have ... birthDate) (if still alive) or birthDate - died) in the first line of the extract. So I guess you can filter only records with an extract matching this regex:

    ^[^.]*\d{4}\)[^.]*\..*
    

    Which will only match texts with something like 2001) in the first row.

    If it's safe to assume that other records don't have it (I'm not sure that it is), then you can stop there. If not, at least you filtered a few more records before checking the revision.

提交回复
热议问题