API to get Wikipedia revision id by date [closed]

冷暖自知 提交于 2019-12-19 10:04:46

问题


Is there any API to get wikipedia revision id by date, instead of checking all the revision history and extract out the most recent revision before that date?

Thank you!


回答1:


The revision query api allows you to pass timestamps to get only revisions from a specified interval. Use

api.php?action=query&prop=revisions&rvlimit=1&rvstart= myTimestamp

Check out the Manual:WfTimestamp for accepted formats - yyyymmddhhmmss always works.




回答2:


Building on the previous answer: The always accepted format yyyymmddhhmmss returned errors. This example returned a valid response:

JSON

XML

The id in field revid contains the id previous to the date passed in param rvstart:

Revision id



来源:https://stackoverflow.com/questions/12906739/api-to-get-wikipedia-revision-id-by-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!