6

Consider the following scenario: I need to retrieve a list of the latest questions asked on three different Stack Exchange sites. I throw together an application that hits up the following routes:

http://api.stackexchange.com/2.1/questions?site=stackoverflow
http://api.stackexchange.com/2.1/questions?site=superuser
http://api.stackexchange.com/2.1/questions?site=askubuntu

This works fine - the only concern is that I'm making three (essentially) identical requests that differ only in the site parameter specified.

I was thinking... wouldn't it be awesome if we could make the site parameter vectorized?

So then I would only be making a single request:

http://api.stackexchange.com/2.1/questions?site=stackoverflow;superuser;askubuntu

...and the response would contain an aggregate of all questions asked on any of those three sites (well, of course only the first 30 would be returned).

Is this feasible? I imagine the implementation on the server might look something like this:

  1. Fetch the /questions route for each of the three sites.
  2. Combine the results, taking the specified sort method into consideration.

...since I'm guessing (based on what I've heard) that you have the SQL table containing the questions for each site in a separate database.

3
  • do you mean 3x30, or results from each site mixed into one set of 30?
    – Jonathan.
    Oct 11, 2012 at 21:23
  • @Jonathan: I was thinking the results for each site mixed into one set of 30. Oct 11, 2012 at 23:56
  • When I think of something like this, I think of something similar to if I were browsing the StackExchange site: stackexchange.com/questions Oct 15, 2012 at 17:27

0

You must log in to answer this question.

Browse other questions tagged .