Get data from URL

Get help using Construct 2

Post » Thu Oct 24, 2013 11:54 am

Im trying to do an app for twitch.tv. I found a way to list usernames in chat on a live stream. Its in json format
https:// tmi.twitch.tv /group/user/ *CHANNEL NAME* /chatters

EXAMPLE :https: // tmi.twitch.tv /group/user/tsm_dyrus/chatters

http:// pastebin.com /vnMGAS9A

But after reading forum for last 3 hours trying various examples i can not get this json data in any way to construct 2 (im trying examples only localy). I tryed loadJson1.2 plugin, construct 2 json functionality and many more. Can some one provide me with a working example. I would be realy greatful.
B
2
G
1
Posts: 9
Reputation: 423

Post » Thu Oct 24, 2013 12:00 pm

The json format could be incompatible to load into an array.

Some in formation about json format
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 1:28 pm

Its not in that format ("c2array": true,) but i can not change it. Maybe i can some how parse it into a variable in C2 as text? then i can text manipulate it as i need.
B
2
G
1
Posts: 9
Reputation: 423

Post » Thu Oct 24, 2013 2:54 pm

I've no experience in this kind of stuff, but:

Maybe you could use the hash table plugin
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 3:25 pm

Yeah thats currently not possible you need to take the hash table plugin and on ajax complete you do:
- Load hash table from Json string AJAX.LastData

After that you can acess the informations via Hash.At("c2array")
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Thu Oct 24, 2013 4:37 pm

Construct 2 uses its own JSON format/parser, if you want to use C2 JSON functions you need to use that format.

You'll have to parse the json server side to make another json but compatible with C2 this time.

Treating your json like a simple string to parse it inside C2 will be a pain in the ass.GamerGon2013-10-24 16:46:01
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,614


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, ignaciosimo and 54 guests