{
name: 'com.riotgames.platform.summoner.PublicSummoner',
keys: [ 'internalName', 'dataVersion', 'acctId', 'name', 'profileIconId', 'revisionDate', 'revisionId', 'summonerLevel', 'summonerId', 'futureData' ],
object: {
internalName: 'mrquackers',
dataVersion: 0,
acctId: { value: 34117327 },
name: 'MrQuackers',
profileIconId: 502,
revisionDate: Tue, 30 Oct 2012 19:38:32 GMT,
revisionId: { value: 0 },
summonerLevel: { value: 30 },
summonerId: { value: 20933307 },
futureData: null
},
encoding: 0
}
(newlines and indentation added by editor; not part of the response)
It's a response from an RTMP packet and I'm not sure how I would go about parsing it. Is there a library in php or a way I can convert this into something easily parsable like json?
No. It is not possible to automatically parse a response if you don't know the language it uses.
While the response looks like JSON, it isn't. It's not even close to JSON. You can't just quote the keys to make it valid JSON.
Except for the revisionDate
, it seems to be valid Javascript, but who knows?
The parser needs to know every data type it might potentially encounter. There's no telling what could appear in the response. Unless you find the documentation for this format, you never know what you might encounter.
You could in theory be able to parse the language you think this response is. But
Conclusion:
You don't know the language the responder talks in. This means you cannot parse it. Find the documentation first, then talk about parsing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With