Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Live Cricket Match Json Help need

Author
Message
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 27th Aug 2021 14:22 Edited at: 27th Aug 2021 16:32
I buy cricket live data from some online website . they sent me .json data but the structure is not proper for my Type Structure . so please help me to solve this .


I also mail them This pic -


Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Aug 2021 17:37 Edited at: 27th Aug 2021 17:47
parse the data and assign the values to whatever variables you want (based on whatever conditions you set).

here, all i'm looking for is "Status" (of "0" (success)) and "data" which are the IP addresses returned, as a simple example.

stripping most delimiters from the string (this$) (actual json here):

...leaves pairs of what i call VARs (variables, separated by ",") and assigning to their Labels and Values (which are separated by ":"):

after variables and their values are logged, i can go and look for all "data" values (IP addresses) and add them to the IP array.
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Aug 2021 23:14
Can you post the .json file?
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 28th Aug 2021 07:16 Edited at: 28th Aug 2021 13:47
@Virtual Nomad Thanks for your answer . but that's not very clear to me .
@blink0K . Sure . The .json files as below . Please watch my video . and sorry for my bad English .
https://youtu.be/tHkqZ44pjSs

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Aug 2021 13:23 Edited at: 28th Aug 2021 13:46
i dont have much time atm but all i meant was that you can read the json, strip it down and assign the values to whatever you want to call the variables:



there might be an easier way using .fromjson or ? but this is all the time i have for this.

the parsing would have to be more sophisticated where, using my strip() function removes things like "https:\/\/api.api-cricket.com\/logo\/30_india.png":
[img]https:\/\/api.api-cricket.com\/logo\/30_india.png[/img]
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]

Attachments

Login to view attachments
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 28th Aug 2021 13:41 Edited at: 28th Aug 2021 13:42
@Virtual Nomad Thankyou for your kind response in my post . But 1st this procedure not solve my problems because the " variables name " change in different matches and how do I know the length will be 20 or 2000 ? and .fromjson is enough which need only 1 line of code and You just need to setup proper type . . Please don't mind, I think this not work for my problems But today I surely try your processes and if I found it's work then I will give you a big big Thanks Love you from INDIA

Login to post a reply

Server time is: 2024-03-29 06:07:56
Your offset time is: 2024-03-29 06:07:56