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 ?

没有正确的解决方案

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top