Skip to content
TORNLIFE More

tonr api (faction>attacks)

Started by gazaras [1673083] on in API Development.

11 replies · 184 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 12 / 12 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
12
Discussion span
→
People posting
4
Likes on archived posts
1
Authority score
66 / 100
Historical score
23 / 100
Story score
29 / 100
Engagement score
52 / 100
gazaras [1673083]

but man i want to get the data how much my faction lost respect and only i getting my faction data not another faction data :) that should work like how much we loose ...
epicaricacy [2040809]

Agreed, that'd be nice.

> It's normal because you can't tell how much they gained from a defend..

I recall reading in the initial newsletter that respect lost is 10% of the respect gained.

There's a possible workaround if you're willing to merge the data from the "attacks" and "attacknews" selections.

Here's an example:
{
"41209839": {
"timestamp_started": 1513538420,
"timestamp_ended": 1513538426,
"attacker_id": "",
"attacker_name": null,
"attacker_faction": "",
"attacker_factionname": null,
"defender_id": null,
"defender_name": "",
"defender_faction": 8819,
"defender_factionname": "Violent if Necessary",
"result": "Mug",
"respect_gain": 0
}
}

{
"230961326":{
"timestamp":1513538426,
"news":"Someone mugged [fac member] (-0.08)"
}
}
Just match the "timestamp" from "attacknews" to "timestamp_ended" from "attacks" and use regex to parse the respect lost.

Edit: Removed faction member that was mugged :D.
gazaras [1673083]

i use attacknews to get that but problem is attacknews dont have last10k attacks it contains small amount and i need use that attacknews apis ask each minutes.. and i dont like that it would be nice to have it in attack....


Harley [258120] Wiki Contributor

Yes you can, when you get attacked you can see the amount of respect lost in the chaining window.

So the number already exists.
epicaricacy [2040809]

There's also "attacknewsfull" which gives the last 10k? I understand it's not ideal, but it's either that or nothing if/until it gets added to the "attacks" selection.