Skip to content
TORNLIFE More

API Changes

Started by McNeo [864688] on in API Development.

18 replies · 366 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 19 / 19 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
19
Discussion span
→
People posting
6
Likes on archived posts
13
Posts by staff, officers and moderators
1
Authority score
75 / 100
Historical score
43 / 100
Story score
41 / 100
Engagement score
63 / 100

Most-liked replies

Mentioned in this thread

Chedburn [1] ×1

McNeo [864688]

It seems there was a change to the API output which broke my program. I've found the change and adapted, but this was unexpected to say the least.

Just as I'm sure you (Torn developers) share what you're working on with each other, it would be nice if us API developers were in the loop as well.

So, here's my question... Could there be an official thread that Torn staff posts API changes to? Heck, feel free to use this thread if you want.

I'm not saying we need to provide input, or that we need to approve, or that we need to comment - nothing like that. My request is simply this... When something changes in the API output, can you guys (Torn developers) post and say "this xxx now does this yyy" just to make us aware. That would be great. Thanks!
McNeo [864688]

This is the change I think just happened, though I could be wrong as I'm not 100% sure what the output was previously. So, for anyone interested, this might be the recent change. If nothing else, let this be an example for the Torn developers - something as simple as this would be very helpful.

Change:
The final object in a section no longer has a comma.

Before:
"1972138":{"name":"Mancini4K","days_in_faction":1,}After:"1972138":{"name":"Mancini4K","days_in_faction":1}
LouBaker [1162207]

I wish they stop doing this, my regex looks for chr$(34)

I did wonder why my script started going wrong, now i know why

12 days ago:
"27369":{"name":"Crystalline","days_in_faction":"749"},
today:
"27369":{"name":"Crystalline","days_in_faction":761},
LouBaker [1162207]

more changes and not a dicky bird about them

old:
{"attacknews":{"179116990":{"timestamp":"1450555595","news":
new:
{"attacknews":{"180062077":{"timestamp":1452106089,"news":
McNeo [864688]

I don't see this one as a big deal, your JSON parser should be smart enough to distinguish a string from a number.

The issue with the one I posted is the removed a comma which was originally being detected as a delimiter.
PMV [1577993]

For the basic profile, seems pretty much all if not most 'numeric strings' like the ID, friends/enemies, etc were all changed to actual integers. Good change.
aurel1 [1046304] Admin Staff

This change was expected I believe, because this was mentioned from the beginning (and this was actually a sort of bug) - all integers and floats from now will not be represented as strings (before it was a bit random, depending on actual DB type).

Such changes should not break anything actually - strings are still strings, and I don't expect, that someone will parse actual integers as strings.

I also think, that we can make a sticky in this forum - I don't expect many changes in near time so should be enough.
McNeo [864688]
Change:
Made status a matrix.

Before:"status":"Okay"After:"status":["Okay", "Traveling to Mexico"]
or
"status":["Okay", ""]
LouBaker [1162207]

Your Script, did you update it with the removed quotes on numbers ie: "" or $chr(34)

Your api message is correct same as mine

{"travel":{"destination":"South Africa","timestamp":1453424690,"time_left":2583}}

Check the your regex routine is reading correctly

see here: http://prntscr.com/9tb528

with irc command line: http://prntscr.com/9tb7on

the vars above in my case hold
  • South Africa
  • 01:04:50
  • 43mins 3secs
hope that helps. give me a shout

Edit:
added link removed text, forum doesn't show correctly
McNeo [864688]

This is a thread for changes, not "what happened." It would be nice if this could stay clean so it can be easily referenced.

Also, you large font is pointless and annoying.

Finally, I have no idea what you mean by "soft touch information." But, don't clarify here, please start a new thread so this can stay organized.

Thanks.
LouBaker [1162207]

Changes to api.torn.com/user/?selections=messages&key=

Before:
{"messages":{"196673550":{"timestamp":"1464597863","from":"1043621","title":"Thanks","seen":"1","read":"1"}

"from" has been replaced with "ID" name "name"

Now:
{"messages":{"196673550":{"timestamp":1464597863,"ID":1043621,"name":"HenkiePuk","title":"Thanks","seen":1,"read":1}
LouBaker [1162207]

Great News Every one


Chedburn [1]I added job points to 'jobpoints' selection in users category. It shows all job points for every company / job the user has earned them for. It was difficult because jobs and companies are totally separate systems and I had no clear way to display current job points clearly.

I also added 'news' and 'newsfull' to company category that seems to be working fine. Exactly like faction news.

Mentions: Chedburn [1]