|
UsageInstructions
Using pynswersUsing pynswers is very easy. It is just one file Answers.py, with one class having four methods. Yahoo answers has four available calls
Each method returns a list of dictionaries. To use Pynswers, import the class and >>>app = Answers()
>>>app.appid = 'your secret yahoo appid'
>>>questions = app.questionSearch({'query':'cats',})
>>>print questions[0]['UserId']questionSearchFind questions that match your query. Parameters listed here are accepted. query is a required parameter. usage>>>app = Answers()
>>>app.appid = 'your secret yahoo appid'
>>>app.questionSearch({'query':'cats',})getByCategoryList questions from one of our hundreds of categories, filtered by type. You'll need the category name or ID, which you can get from questionSearch. Parameters listed here are accepted. Either category_id or category_name is a required. Usage>>>app.getByCategory({'category_id':'396546304'})getQuestionFound an interesting question? getQuestion lists all the details for every answer to the question ID you specify, including the best answer, if it's been chosen. Get that question ID from questionSearch or getByCategory. Parameters listed here are accepted. question_id is a required parameter. Usage>>>app.getQuestion({'question_id':'20070331070321AAlyopp'})getByUserList questions from specific users on Yahoo! Answers. You'll need the user id, which you can get from any of the other services listed above. Parameters listed here are accepted. user_id is a required parameter. |
Sign in to add a comment