鉴于 WikipediaAPI(英文维基百科上的一篇文章的标题),我的 url 提供了一个 JSON :
var url = "http://en.wikipedia.org/w/api.php?action=query&prop=description&titles=Unicorn&prop=extracts&exsentences=10&explaintext&format=json";
响应如下所示:
{
"query": {
"pages": {
"ramdom_number_here": {
"pageid": ramdom_number_here,
"ns": 0,
"title": "Unicorn",
"extract": "The unicorn is a legendary animal that has been described since antiquity as a beast with a large, pointed, spiraling horn projecting from its forehead."
}
}
}
}
鉴于<ramdom_number_here>
每篇文章的变化,因此是不可预测的。
如何把握extract
或title
重用它的价值?