Skip to content
TORNLIFE More

Faction news selection changes

Started by Chedburn [1] Admin on in API Development.

5 replies · 501 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 6 / 6 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
6
Discussion span
→
People posting
3
Likes on archived posts
19
Posts by staff, officers and moderators
3
Authority score
83 / 100
Historical score
51 / 100
Story score
38 / 100
Engagement score
60 / 100

Most-liked replies

Chedburn [1] Admin Developer
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] Admin Developer
As a reminder, today we'll be implementing the 100,000 daily limit on rows read per day per user from faction news. Thanks.
Helcostr [1934501] Wiki Editor
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)
Chedburn [1] Admin Developer
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?
Helcostr [1934501] Wiki Editor
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?
SirEdge [2609907]
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.