雅虎答案 API
我想利用雅虎答案 API 来提取答案,我已经获得了我的用户密钥,我想这是访问网站上发布的答案所必需的。任何人都可以指导我如何从我的应用程序中使用此 API。
I want to make use of the Yahoo answers API to extract the answers, I have got my consumer key which I guess is ncessary to get an access to the answers posted on the website. Can anybody guide me as to how can I make use of this API from my application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,既然您扩展了您的问题,我至少会为您指出正确的方向:
您说您想获得特定问题的答案。
这是通过向 getQuestion 方法发出 GET 请求来实现的,该方法已记录在该链接中,所以我不会在这里重复说明。
此方法需要您了解 Yahoo!答案
question_id
,您可以通过从已知问题的 URL 中获取答案来对其进行硬编码,也可以使用其他 API 方法(例如 questionSearch。您得到的响应将是 XML,并且特定问题的答案将在其中 - 以及其他数据,例如回答者的昵称、时间戳等。
您需要解析此响应以获取所需的信息。
如果您需要使用 Perl 发出 GET 请求的帮助,我会看看这个问题 首先,但本质上是:
OK, since you expanded on your question, I'll point you in the right direction at least:
You say you want to get the answers for a particular question.
That is achieved by making a GET request to the getQuestion method, which is documented at that link, so I won't repeat the instructions here.
This method requires you to know the Yahoo! Answers
question_id
, which you can either hard-code by taking it from the URL of a known question, or search for it using the other API methods such as questionSearch.The response you get back will be XML, and the answers to the specific question will be in there - among other data such as the answerer's nickname, timestamps etc.
You'll need to parse this response to get the info you need.
If you need help making a GET request using Perl, I'd take a look at this question here first, but it's essentially: