0

我使用 YQL 从 answers.yahoo.com 中提取数据,方法是使用子句:“select * from answers.getbycategory where category_id=396545299”。您可以在http://developer.yahoo.com/yql/console/尝试一下。

这里的 396545299 表示 catagory_id 是“书籍和作者”,您可以在http://answers.yahoo.com/dir/index;_ylt=Aptj80jBf2NtgwbZw_f_g5Kf5HNG;_ylv=3?sid=396545299&link=open#yan-questions中查看原始数据

我发现使用 YQL 的数据不完整,为什么?

谢谢!

4

1 回答 1

0

现在尝试这个似乎可以正常工作。这可能是一个临时错误,或者是 YQL 和 Yahoo Answers 之间的某种速率限制或阻塞。通常您可以查看diagnostics返回数据以获取更多线索。

例如这个查询:

select * from answers.getbycategory where category_id=396545299

结果返回此数据:

cbfunc({
 "query": {
  "count": 10,
  "created": "2012-06-20T01:02:27Z",
  "lang": "en-US",
  "diagnostics": {
   "publiclyCallable": "true",
   "url": {
    "execution-start-time": "22",
    "execution-stop-time": "779",
    "execution-time": "757",
    "proxy": "DEFAULT",
    "content": "http://answers.yahooapis.com/AnswersService/V1/getByCategory?category_id=396545299&start=0&results=10"
   },
   "user-time": "780",
   "service-time": "757",
   "build-version": "28117"
  },
  "results": {
   "Question": [
    {
     "id": "20120619180104AAhkAbT",
     "type": "Open",
     "Subject": "Cool names for Mage In novel?",
     "Content": "Ok, I'm writing a book about a boy that secretly does magic, but can't tell anyone because everybody disapproves, it's considered a sin to do magic to the people in the kingdom, and the king actually beheads people who do it. But I can't think of a good name for the Mage.\n",
     "Date": "2012-06-19 18:01:04",
     "Timestamp": "1340154064",
     "Link": "http://answers.yahoo.com/question/?qid=20120619180104AAhkAbT",
     "Category": {
      "id": "396545299",
      "content": "Books & Authors"
     },
     "UserId": "zpgtqzI6aa",
     "UserNick": null,
     "UserPhotoURL": null,
     "NumAnswers": "0",
     "NumComments": "0",
     "ChosenAnswer": null,
     "ChosenAnswererId": null,
     "ChosenAnswererNick": null,
     "ChosenAnswerTimestamp": null,
     "ChosenAnswerAwardTimestamp": null
    },
   ...etc...
于 2012-06-20T01:06:44.460 回答