Faction news selection changes | API Development | TORN
Faction news selection changes
  • Ðé Chedburn [1]Chedburn [1]
    • Chedburn [1]
    • Role: Admin
    • Level: 15
    • Posts: 24911
    • Karma: 42342
    • Last Action: 3 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 14:58:44 - 06/04/21 (6 months ago)
    |
    Last replied 21:10:41 - 17/06/21 (4 months ago)
    Hi everyone,

    Using from/to timestamps is now available for the faction news selections, with 'to' being optional.

    By default, 100 rows will continue to be shown in time descending order.
    If timestamps are provided, up to 1,000 rows will be included and the default ordering will change to time ascending.
    You can now also include a 'sort' preference to order the results by time, either asc or desc.

    The 'full' news selections which simply increased the amount of rows to 1,000 (i.e. armourynewsfull) will be entirely removed.

    More importantly, we'll be placing a 100,000 daily limit on rows per day from faction news. This is to incentivise developers to be less inefficient with their requests. There is now no need to request the same rows over and over again when looking for new results, you only need to search for rows made after the timestamp of your previous request.

    Thanks.
  • Ðé Chedburn [1]Chedburn [1]
    • Chedburn [1]
    • Role: Admin
    • Level: 15
    • Posts: 24911
    • Karma: 42342
    • Last Action: 3 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 10:11:31 - 13/04/21 (6 months ago)
    Post link copied to clipboard Copy post link
    As a reminder, today we'll be implementing the 100,000 daily limit on rows read per day per user from faction news. Thanks.
  • PM Helcostr [1934501]Helcostr [1934501]
    • Helcostr [1934501]
    • Role: Wiki Editor
    • Level: 15
    • Posts: 2787
    • Karma: 1367
    • Last Action: 2 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 11:56:46 - 13/04/21 (6 months ago)
    Post link copied to clipboard Copy post link
    Oh i just thought of something: I program with multiple calls bundled into one (to stay under the api limit) like so:

    https://api.torn.com/faction/?comment=&selections=fundsnews,donations,membershipnews&key=

    However, I don't think I can specifically describe to and from per section.

    Is this intentional, can this be improved so that I don't have to call the API more than I have to?

    I am open to discussion, but I am also not sure how to approach this problem just yet: I only cut down my news calling from 1440*100 to 1440/5*100 as a temporary measure.

    My solution (that is my end only) might just have to be take the lowest timestamp out of the three sections I am calling, but I might end up with 100 calls per minute again... maybe 1000 if I am unlucky.

    I'd rather not break it into 3 separate API calls, but I will if I must :(

    That said... can a post body work for API (since we might run out of room in the url call)
    Last edited by Helcostr on 12:04:54 - 13/04/21
  • Ðé Chedburn [1]Chedburn [1]
    • Chedburn [1]
    • Role: Admin
    • Level: 15
    • Posts: 24911
    • Karma: 42342
    • Last Action: 3 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:12:47 - 13/04/21 (6 months ago)
    Post link copied to clipboard Copy post link
    The solution would be to split them up into multiple calls - yep! Maybe we can add a new 'news' selection which has everything except attacks?
  • PM Helcostr [1934501]Helcostr [1934501]
    • Helcostr [1934501]
    • Role: Wiki Editor
    • Level: 15
    • Posts: 2787
    • Karma: 1367
    • Last Action: 2 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:01:23 - 13/04/21 (6 months ago)
    Post link copied to clipboard Copy post link
    Fair enough. I was dreading splitting the API calls cuz of the 100 per minute limit.

    Hm... you say news section... but also I am thinking about how logs work (where you can supposedly filter out what you need via the category)... can we have that feature for news as well?

    Or maybe have a log for factions that is not pre-html-formatted?
    Last edited by Helcostr on 16:02:00 - 13/04/21
  • AVAL SirEdge [2609907]SirEdge [2609907]
    • SirEdge [2609907]
    • Role: Civilian
    • Level: 50
    • Posts: 2061
    • Karma: 1569
    • Last Action: 5 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:10:41 - 17/06/21 (4 months ago)
    Post link copied to clipboard Copy post link
    Would love to be able to use the sort on days in faction on the faction basic query to make it easy to set it ASC and then grab new records several times per day and then only do a full comparison once per day.  Parsing all of that out of the logs or a full reconciliation multiple times per day sounds like a hassle, relatively speaking.

    88325a84-98c2-374d-2609907.gif

Reply
Thread Title: