Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I am really struggling with this one...

Given a user ID, how can I monitor questions that that user has asked for new answers?

I'm worried the solution will look something like this:

  • Get all questions for a given user
  • Get answer_count for each of them
  • Compare each answer_count to the stored number from the last check
  • If any two don't match, then an answer has been added or deleted
  • Repeat at specified interval

Is there a better way?
Is there some way to get all answers posted to a user's questions between a given time span?

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

You can use sort=creation and min to pull in only new answers given a list of question ids and the questions/{id}/answer route.

You can do the equivalent with users/{id}/questions to monitor for new questions.

That will let you monitor up to 100 questions a request.

share|improve this answer
    
Kevin: I'm a bit surprised by this, and I have to think it's intentional. Wouldn't one of the MOST COMMON API REQUESTS be "get me all new answers to any of my questions?". I imagine, however, that if a proliferation of notifiers appeared, people would check the sites less, and the community would suffer. –  Portman Jun 26 '10 at 3:32
1  
Links not working. –  Charles Stewart Jul 2 '10 at 3:39
add comment

Just make an API request every few minutes and parse it out then compare it. That's the only way I can think of. Sure it'll be a lot of code, but you gotta do what you gotta do

share|improve this answer
add comment

I think polling with /users/{id}/questions is the best option here. I don't think you have to compare the answer_counts though. You could try the fromdate param on the api call, and just save the time of the last request. Then anything in the response must be after that time and therefore new.

share|improve this answer
    
Does fromdate only return questions with new answers? Otherwise it won't work. –  Nathan Osman May 26 '10 at 4:34
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .