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.
-
1Not without some details of what your application is and what you've already tried, no. – Widor Sep 20 '11 at 14:04
-
say i want to get the answers for a particular question, how should i get it, like what syntax should i use, i am coding in perl. – AAB Sep 20 '11 at 14:37
-
Related: [Yahoo Answers API not working](http://stackoverflow.com/q/21943000/55075) – kenorb Mar 17 '15 at 16:18
1 Answers
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:
use LWP::Simple;
$contents = get("http://YOUR_URL_HERE");