Wiki Mod Popular Post Dr Rush Posted March 17, 2016 Wiki Mod Popular Post Share Posted March 17, 2016 (edited) Sheepy lasted time you were bugged about it you said give you an explicit example of what we wanted. So me & Yosodog have prepared these examples. ../api/wars.json roughly equivalent in purpose & layout to nations & alliances { "wars": [ { "warID":<integer>, "attacker": <integer, nation id>, "defender": <integer, nation id>, "attackerAA": <integer, alliance id>, "defenderAA": <integer, alliance id>, "status": <string, active/victor/white peace/timeout>}, "date": <date, <date & time of DoW>, } // another war ] } ../api/war/id=12345.json A detailed listing of info about a single given war. { "warID": <integer>, "status": <string/active,completed,expired>, "openDate:<date, <date & time of DoW>, "closeDate": <date, <date & time of war ending/null if active>, "controls": { "ground": <attacker|defender|none>, "air": <attacker|defender|none>, "naval": <attacker|defender|none> }, "groundITs": { "side": <attacker|defender|none>, //Who is "winning" the war "ITs": <number of immenses the winning side has.> "attacker": { "attackerNationID": <integer>, "attackerAllianceID": <integer> "losses": { "soldiers": <integer>, "tanks": <integer>, "aircraft": <integer>, "ships": <integer>, "money": <integer> }, }, "defender": { "defenderNationID": <integer>, "defenderAllianceID": <integer> "losses": { "soldiers": <integer>, "tanks": <integer>, "aircraft": <integer>, "ships": <integer>, "money": <integer> }, }, "attacks": [ { "timestamp": <string/timestamp of attack>, "type": <string/ground,air,navy,missile,nuke>, "outcome": <string,overwhelming,moderate,etc>, "losses": { "soldiers": <integer>, "tanks": <integer>, "aircraft": <integer>, "ships": <integer>, "money": <integer> // And any other things that can happen during an attack } } { "timestamp": <string/timestamp of attack>, "type": <string/ground,air,navy,missile,nuke>, "outcome": <string,overwhelming,moderate,etc>, "losses": { "soldiers": <integer>, "tanks": <integer>, "aircraft": <integer>, "ships": <integer>, "money": <integer> // And any other things that can happen during an attack } } { "timestamp": <string/timestamp of attack>, "type": <string/ground,air,navy,missile,nuke>, "outcome": <string,overwhelming,moderate,etc>, "losses": { "soldiers": <integer>, "tanks": <integer>, "aircraft": <integer>, "ships": <integer>, "money": <integer> // And any other things that can happen during an attack } } // And so on for every attack // This could be too much info. Maybe separate them into another API? ] } Only real note here is if the timeline makes the war page to long it can be separated out into a different api page. Edited March 23, 2016 by Dr Rush 8 Quote 23:38 Skable that's why we don't want Rose involved, so we can take the m all for ourselves 23:39 [] but Mensa is the cute girl at the school dance and she's only dancing with us right now to get our friend jealous 23:39 [] If Rose comes in and gives Mensa what she wants, she'll just toss us aside and forget we ever existed 23:39 zombie_lanae yeah I do hope we can keep having them all to ourselves 23:40 zombie_lanae I know it's selfish but I want all their love 6:55 PM <+Isolatar> Praise Dio Pubstomper|BNC [20:01:55] Rose wouldn't plan a hit on Mensa because it would be !@#$ing stupid Link to comment Share on other sites More sharing options...
Yosodog Posted March 17, 2016 Share Posted March 17, 2016 DO IT SHEEPY JUST DO IT 1 Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Beatrix Posted March 17, 2016 Share Posted March 17, 2016 DO IT SHEEPY JUST DO IT Things not to tell someone suicidal. Quote Link to comment Share on other sites More sharing options...
Andrezj Kolarov Posted March 17, 2016 Share Posted March 17, 2016 DO IT SHEEPY JUST DO IT DON'T LET YOUR DREAMS BE DREAMS Quote People's Republic of Velika: National Information Link to comment Share on other sites More sharing options...
Kid Winchell Posted March 17, 2016 Share Posted March 17, 2016 Yes please. Although if this format is used, control could just be one of the participant's name/id, instead of unnecessarily listing it twice. Quote Link to comment Share on other sites More sharing options...
Wiki Mod Dr Rush Posted March 17, 2016 Author Wiki Mod Share Posted March 17, 2016 Yes please. Although if this format is used, control could just be one of the participant's name/id, instead of unnecessarily listing it twice. Can you clarify what you mean here please? Quote 23:38 Skable that's why we don't want Rose involved, so we can take the m all for ourselves 23:39 [] but Mensa is the cute girl at the school dance and she's only dancing with us right now to get our friend jealous 23:39 [] If Rose comes in and gives Mensa what she wants, she'll just toss us aside and forget we ever existed 23:39 zombie_lanae yeah I do hope we can keep having them all to ourselves 23:40 zombie_lanae I know it's selfish but I want all their love 6:55 PM <+Isolatar> Praise Dio Pubstomper|BNC [20:01:55] Rose wouldn't plan a hit on Mensa because it would be !@#$ing stupid Link to comment Share on other sites More sharing options...
Kid Winchell Posted March 18, 2016 Share Posted March 18, 2016 Can you clarify what you mean here please? Instead of { attacker: { control: { <type>: <boolean> } ... } defender: { control: { <type>: <boolean> } ... } ... } just do { attacker {...} defender {...} control: { <type>: <attacker|defender|none> //The actual value could be their name or id or even just "attacker" or "defender" } ... } because only one nation can have control at a time, so listing a set of booleans twice is redundant (if one is true, the other is guaranteed to be false, and therefore doesn't need to be listed). And the case where neither has control can be easily dealt with using a null value, which is also shorter than two sets that both say false. Quote Link to comment Share on other sites More sharing options...
Yosodog Posted March 18, 2016 Share Posted March 18, 2016 Instead of { attacker: { control: { <type>: <boolean> } ... } defender: { control: { <type>: <boolean> } ... } ... } just do { attacker {...} defender {...} control: { <type>: <attacker|defender|none> //The actual value could be their name or id or even just "attacker" or "defender" } ... } because only one nation can have control at a time, so listing a set of booleans twice is redundant (if one is true, the other is guaranteed to be false, and therefore doesn't need to be listed). And the case where neither has control can be easily dealt with using a null value, which is also shorter than two sets that both say false. Yeah, agreed. That would be a better way to do it. Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Dalinar Posted March 18, 2016 Share Posted March 18, 2016 You guys and this suggestion are great. Quote I will take responsibility for what I have done, if I must fall, I will rise each time a better man. Link to comment Share on other sites More sharing options...
Wiki Mod Dr Rush Posted March 18, 2016 Author Wiki Mod Share Posted March 18, 2016 (edited) Yeah, agreed. That would be a better way to do it. Agreed, my personal preference for values is attacker/defender/null. As thats always consistent & thus easier to program using. Another question would be whether these should be top level properties or part of a 'controls' object. Edited March 18, 2016 by Dr Rush Quote 23:38 Skable that's why we don't want Rose involved, so we can take the m all for ourselves 23:39 [] but Mensa is the cute girl at the school dance and she's only dancing with us right now to get our friend jealous 23:39 [] If Rose comes in and gives Mensa what she wants, she'll just toss us aside and forget we ever existed 23:39 zombie_lanae yeah I do hope we can keep having them all to ourselves 23:40 zombie_lanae I know it's selfish but I want all their love 6:55 PM <+Isolatar> Praise Dio Pubstomper|BNC [20:01:55] Rose wouldn't plan a hit on Mensa because it would be !@#$ing stupid Link to comment Share on other sites More sharing options...
Wiki Mod Dr Rush Posted March 23, 2016 Author Wiki Mod Share Posted March 23, 2016 Updated to a single independent control object. Ground ITs are listed separately as two pieces of info were needed & thus an object & I don't want to tree those to deeply. Quote 23:38 Skable that's why we don't want Rose involved, so we can take the m all for ourselves 23:39 [] but Mensa is the cute girl at the school dance and she's only dancing with us right now to get our friend jealous 23:39 [] If Rose comes in and gives Mensa what she wants, she'll just toss us aside and forget we ever existed 23:39 zombie_lanae yeah I do hope we can keep having them all to ourselves 23:40 zombie_lanae I know it's selfish but I want all their love 6:55 PM <+Isolatar> Praise Dio Pubstomper|BNC [20:01:55] Rose wouldn't plan a hit on Mensa because it would be !@#$ing stupid Link to comment Share on other sites More sharing options...
Shakyr Posted April 3, 2016 Share Posted April 3, 2016 Also have a listing of wars for a particular nation available, as I've defined in my previous suggestion. https://politicsandwar.com/forums/index.php?/topic/11365-nation-api-layout-suggestion/ Quote Link to comment Share on other sites More sharing options...
Wiki Mod Dr Rush Posted April 7, 2016 Author Wiki Mod Share Posted April 7, 2016 Also have a listing of wars for a particular nation available, as I've defined in my previous suggestion. https://politicsandwar.com/forums/index.php?/topic/11365-nation-api-layout-suggestion/ Would be simpler to just add an array to the nation api. Quote 23:38 Skable that's why we don't want Rose involved, so we can take the m all for ourselves 23:39 [] but Mensa is the cute girl at the school dance and she's only dancing with us right now to get our friend jealous 23:39 [] If Rose comes in and gives Mensa what she wants, she'll just toss us aside and forget we ever existed 23:39 zombie_lanae yeah I do hope we can keep having them all to ourselves 23:40 zombie_lanae I know it's selfish but I want all their love 6:55 PM <+Isolatar> Praise Dio Pubstomper|BNC [20:01:55] Rose wouldn't plan a hit on Mensa because it would be !@#$ing stupid Link to comment Share on other sites More sharing options...
Seryozha Nikanor Posted April 7, 2016 Share Posted April 7, 2016 Doing gods work son. Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted April 8, 2016 Administrators Share Posted April 8, 2016 You can check out http://alex.politicsandwar.com/api/wars.php Will be up on the live server under the same directory after the next patch. Shows the latest 1,500 wars. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Yosodog Posted April 8, 2016 Share Posted April 8, 2016 Holy !@#$ it's actually happening. Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Kid Winchell Posted April 9, 2016 Share Posted April 9, 2016 Holy !@#$ it's actually happening. Now we get to choose something else to complain about incessantly! Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted April 9, 2016 Administrators Share Posted April 9, 2016 It should be up on the live server now, https://politicsandwar.com/api/wars.php Do you need last 1,500 records? Kind of an arbitrary limit, but we keep war data in the DB for the last month, but that's a lot of records on the live server. I wouldn't mind shrinking that amount to lighten server load, but if you'd need to look at potentially that many records, I can leave it as-is. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Kid Winchell Posted April 9, 2016 Share Posted April 9, 2016 (edited) The date string should be changed to something that is standards-compliant. Not all programming languages support parsing dates in the format they are currently given, but pretty much every language (that has date parsing capabilities) should support the standard. Also, the link should be /wars/ instead of /wars.php because consistency. Edited April 9, 2016 by Roll Sheepy Quote Link to comment Share on other sites More sharing options...
Yosodog Posted April 9, 2016 Share Posted April 9, 2016 The date string should be changed to something that is standards-compliant. Not all programming languages support parsing dates in the format they are currently given, but pretty much every language (that has date parsing capabilities) should support the standard. Also, the link should be /wars/ instead of /wars.php because consistency. The date string is probably how it's stored in the database. It's in the typical SQL datetime format. I know a thing we can !@#$ about now, and individual war API It should be up on the live server now, https://politicsandwar.com/api/wars.php Do you need last 1,500 records? Kind of an arbitrary limit, but we keep war data in the DB for the last month, but that's a lot of records on the live server. I wouldn't mind shrinking that amount to lighten server load, but if you'd need to look at potentially that many records, I can leave it as-is. 1500 might not be enough depending on how big a war is. iirc, last war BK alone had 500+ wars alongside tS and Mensa wasn't far behind. I guess I'll bug you next war if we start getting close to 1500. Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Buorhann Posted April 9, 2016 Share Posted April 9, 2016 This is why BK, Syndicate, and Mensa side is great~ Damn techies up in here. 1 1 Quote Warrior of Dio https://www.youtube.com/watch?v=mfPCFQfOnLg Link to comment Share on other sites More sharing options...
Administrators Alex Posted April 10, 2016 Administrators Share Posted April 10, 2016 You can now use https://politicsandwar.com/api/war/ It now defaults to show only the last 100 rows. If you want to see more, you can enter in the number of wars you want to see, up to 2,000 like so: https://politicsandwar.com/api/war/2000 Also updated the date format to be how you want it I know a thing we can !@#$ about now, and individual war API Haven't gotten to this yet. The wars API was easier and I was bored in class the other day so I threw it together quick. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Yosodog Posted April 10, 2016 Share Posted April 10, 2016 You can now use https://politicsandwar.com/api/war/ It now defaults to show only the last 100 rows. If you want to see more, you can enter in the number of wars you want to see, up to 2,000 like so: https://politicsandwar.com/api/war/2000 Also updated the date format to be how you want it Haven't gotten to this yet. The wars API was easier and I was bored in class the other day so I threw it together quick. All good, I'm happy with any kind of attention the API gets. The link appears to be broken though. Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Administrators Alex Posted April 10, 2016 Administrators Share Posted April 10, 2016 All good, I'm happy with any kind of attention the API gets. The link appears to be broken though. Ah, I meant /wars/ not /war/ https://politicsandwar.com/api/wars/ https://politicsandwar.com/api/wars/2000 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Yosodog Posted April 11, 2016 Share Posted April 11, 2016 Ah, I meant /wars/ not /war/ https://politicsandwar.com/api/wars/ https://politicsandwar.com/api/wars/2000 Is there some kind of limit on this? 1,999 looks like it shows 1,999 but when I put 2,000+ it seems the default 100. Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.