Deep Bot - Twitch Streamer Assistant
Deep Bot => Feature Requests => Topic started by: TheDefiant604 on April 26, 2017, 07:35:44 PM
-
Could a way to process JSON data from a file be added? Something like @readjsonfile@[file.txt,payload.object.key].
This would reduce demand on API servers for commands that need to read multiple values. I currently have a command that reads eight values from an API. That means eight separate requests to the API each time the command is run. Even more, if I add more information to the command. It would be much more efficient if I could make a single API request and store the JSON payload in a file that I could then read as many times as needed.
Example:
@savefile@[jsonpayload.txt,@customjsonapi@[https://site.com/api]]Value 1 is @readjsonfile@[jsonpayload.txt,payload.object.key1]. Value 2 is @readjsonfile@[jsonpayload.txt,payload.object.key2].
* Probably have to use @customapi@ to retrieve the whole payload, to avoid an error from @customjsonapi@ not being given the "field" variable.
-
If you have a website of your own you could make a api that spits out all the info from a single json in one go
-
If you have a website of your own you could make a api that spits out all the info from a single json in one go
I ended up doing this. I finally found a free web host, without advertisements, that allows PHP. So now I'm making a single @customapi@ request to a script I wrote that is making a single request to the necessary JSON API, and outputting a formatted string that includes all the necessary data.
For anyone else trying to do this, https://freehosting.host/ offers free web hosting without any advertisements, with SSL/TLS, PHP, PERL, SQL, FTP and e-mail. Setup requires a $0.01 verification charge via PayPal, which is refunded the next day. For more information: https://freehosting.host/products/compare-web-hosting-plans/
-
This tool might help: json formatter (https://jsonformatter-online.com/)