Question

I have a question about Yahoo answer api. I plan to use (questionSearch, getByCategory, getQuestion, getByUser). For example I used getByCategory to query. Each time I call the function, I can query max 50 questions. However, there are a lot of same questions which have been queried in previous time. So How can I remove this redundent ?

No correct solution

OTHER TIPS

The API doesn't track what it has returned to you previously as its stateless.

This leaves you with two options that I can think of.

1) After you get your data back filter out what you already have. This requires you checking what is displayed and then not displaying duplicated items.

2) Store all ID's you have showing in a list, then adjust your YQL Query so that it provides that list of ID's as ones not to turn. Like:

select * from answers.getbycategory where category_id=2115500137 and type="resolved" and id not in ('20140216060544AA0tCLE', '20140215125452AAcNRTq', '20140215124804AAC1cQl');

The downside of this, is that it could effect performance since your YQL queries will start to take longer and longer to return.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top