1

The API documentation describes tthe usage of /questions/featured. Unfortunately there does not seem to be a way to sort the result by bounty_closes_date, which is IMO the sort option making most sense (both ascending and descending) for featured questions. Is there another way (other than doing it by programmatically after having consumed the search result in an app) to sort by bounty close date?

BTW, what I really want is an RSS feed sorted by bounty close date in descending order because I am interested to see the latest featured questions which just got a new bounty. The RSS feed sorts the other way around (or in which ever order), though, and only shows 30 or so questions, so the latest bounties are never visible.

1
  • Why the downvote? Was my question phrased in a bad way? Hard to understand? Sloppy in style? Showing a blatant lack of reaearch?
    – kriegaex
    Commented Mar 10, 2017 at 15:16

1 Answer 1

1

This is most likely one of those things you'll have to do yourself and one reason why the API is available.
And, it's not too hard; here is pseudo code that works:

  1. Call /questions/featured with max page-size and (ideally) filtered by your tag(s) of interest. EG:
    /questions/featured?pagesize=100&tagged=javascript

  2. Page through the results until has_more is false.

  3. Sort the resulting array by bounty_closes_date in your own code.

  4. Display to taste.

  5. Done!

3
  • I agree that this is currently the way to sort bounty questions by bounty_closes_date, but the original poster had a good point, in the sense that this sorting could be better done on the back end (as it is for other API queries). And if the multiple queries don't return the "has_more" flag reliably (as we've both seen), the list will stop (start?) somewhere in the middle, which would be unfortunate. Commented Apr 27, 2017 at 21:56
  • @RapunzelVanWinkle, yes, the sorting can be done more effectively on the back end, but it's not the purpose of API's to handle every contingency and edge case. Rather they provide a framework for interested 3rd parties to do so. ... The OP's request is not unreasonable; it's just unlikely & low priority. ... The has_more issue is not related; it's a bug that can be worked around and will be fixed some day. I would call it "very high priority", and you can see it's been weeks with no action. ... So it's only prudent to tell the OP he'll have to support this particular "long tail" himself. Commented Apr 27, 2017 at 22:55
  • Well, I agree that a special RSS feed as described in the original question is a low priority. And I agree that fixing the "has_more" issue is a high priority (much higher than providing the back end sorting I wanted). But I don't see sorting featured questions by bounty_close_date as an obscure edge case. They're sorted that way on stackoverflow.com (I assume using an algorithm like you described, though they might use a nonpublic API for all I know). Commented Apr 27, 2017 at 23:25

You must log in to answer this question.

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