My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
UsageInstructions  

Featured, Phase-Deploy
Updated Feb 4, 2010 by shabda.r...@gmail.com

Using pynswers

Using pynswers is very easy. It is just one file Answers.py, with one class having four methods.

Yahoo answers has four available calls

  1. questionSearch
  2. getByCategory
  3. getQuestion
  4. getByUser
Pynswers has four methods called(wonder!)
  1. questionSearch
  2. getByCategory
  3. getQuestion
  4. getByUser

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']

questionSearch

Find 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',})

getByCategory

List 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'})

getQuestion

Found 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'})

getByUser

List 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.

Comment by auduwage, Nov 7, 2011

I was wondering if you can let me know what kind of information related to user is available via api.


Sign in to add a comment
Powered by Google Project Hosting