perchance.org/api/getGeneratorList?max=123 - limit to a maximum of 123 generators

Are they latest-first?

It doesn’t seem like this “max” has to do with how many generators are returned. But the number returned does scale with it. So… last-updated age, perhaps? Not sure what unit of time it would be though. Quite confused.

Could be that it’s the max, before it removes private generators? Which would kind of make it not be the “maximum” anything really. Not a very useful parameter as it would be if it would actually give X number of generators–for paging, etc.

(Speaking of which is there a way of specifying “start from X generator number and later” for paging to work well?)

I don’t know what the default “max” or whatever is for this api. Seems to fluctuate how many are returned, and it’s not always a round number.

  • @perchanceM
    link
    English
    12 months ago

    Are they latest-first?

    Yes, they should be.

    Could be that it’s the max, before it removes private generators?

    Correct! But it also hides based on some heuristics to prevent forks of popular generators by newbies being 50% of the results or whatever, since sometimes forks are accidental, and often they’re not “interesting” - i.e. user is just trying out forking for the first time and so just makes one small edit. IIRC this is type of filtering is based on something like needing at least a couple of edits if the account is new.

    Currently there is no pagination. I’d like to fix all this up, add search, etc. at some point but it’s not a top priority right now - though it can become a higher priority through pestering, of course.

    • @wthit56OP
      link
      English
      12 months ago

      I notice lastEditTime_ago is not included for getGeneratorStats.

    • @wthit56OP
      link
      English
      12 months ago

      It seems for generatorStats, tags are not included in the metaData object?

    • @wthit56OP
      link
      English
      12 months ago

      What is the publicId? Is it useful for anything, or just internal legacy type stuff?

    • @wthit56OP
      link
      English
      12 months ago

      Some APIs have status: “success”, others use success: true. Which is… a thing. 😂

      Might be a good idea to have both on all of them? Or pick on and make sure they all use it. Then people (meaning me) wouldn’t have to check for both or get confused about which is which.

    • @wthit56OP
      link
      English
      12 months ago

      Ah okay… I feel like that “max” thing is not ideal because people need to know pretty in-depth knowledge of how the server works in order to even understand what that parameter does, know what I mean? 😅 I’ll have to explain all this in my api plugin.

      Is it called “max” because all it says is you can’t get more than that number, and nothing more than that?

      I know for backwards-compatibility you can’t change that. But maybe a different param for “actually how many generators I want to get back, no more, no less please thanks.”

    • @wthit56OP
      link
      English
      12 months ago

      Oh, and I feel like there’s a default “max” or perhaps some other way it decides how much to give back if nothing is specified… what is that?