Skip to content
TORNLIFE More

Attacks Key consistency

Started by MagicJoker [2070851] on in API Development.

3 replies · 103 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 4 / 4 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
4
Discussion span
→
People posting
4
Likes on archived posts
0
Authority score
50 / 100
Historical score
19 / 100
Story score
23 / 100
Engagement score
41 / 100
MagicJoker [2070851]
So I am creating a CLI app for myself to track attacks during a chain. When I request my attacks from https://www.torn.com/api.html I seem to get a full list of the last N number of attacks and the keys are consistent, yet when I am requesting via my http client they just come back all over the place and not in the same quantity?

is this a quirk of Torn? Theres obviously no pagination I am missing from this API right?
LouBaker [1162207]
Iv have tested this and see what you mean

the HTTP listing is in reverse order for some reason, the lastest attacks are at the top

but when downloaded the lastest attacks are at the bottom

iv no idea why this is
Kivou [2000607]
The API throws an object which is not supposed to be ordered.

I'm not sure about the other languages but in python the equivalent is a dictionary which wouldn't have the fancy hash lookup if ordered.

But for the number of attacks it should be 100 (sometimes less if you enter from and to timestamps).
Stiny [992186]
Calling attacks detailed will give you the last 100.
Calling just attacks gives the last 1000.
Attack ids are unique and can be used for de duplication before inserting into a database. Additionally attacks and revives can be ordered by these ids or by the time stamp inside the payload.