appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

Allow filtering of polling endpoints #290

Open wjlafrance opened 11 years ago

wjlafrance commented 11 years ago

For reposted.me, I'm currently crawling the entire history of a user's posts, 200 posts at a time, to filter in my app. Since the app only deals with posts that have been reposted or starred, I receive a lot of data from the API that is essentially noise. To crawl all posts for a user takes N calls to the API, N being their number of posts divided by 200. Being able to use this filter would be able to decrease the number of API calls being made to 1 in nearly all cases:

{match_policy: "include_any", clauses: [
 {operator: "gt", field: "/data/num_reposts", object_type: "post", value: 0},
 {operator: "gt", field: "/data/num_stars", object_type: "post", value: 0}
], name: "Starred or Reposted"}

API endpoint being used: http://alpha-api.app.net/stream/0/users/#{id}/posts

derelk commented 11 years ago

+1 This would be very helpful and greatly improve efficiency. The structure of filters is good, but we need to be able to use them in more places.

wjlafrance commented 11 years ago

I changed the title and edited the original post with a bit more content to describe the actual problem I'm facing. I must have been very tired when I wrote the original, or perhaps overestimating the omniscience of the community. :)