Raised This Month: $51 Target: $400
 12% 

Parse/Decode JSON


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 04-23-2014 , 07:03   Parse/Decode JSON
Reply With Quote #1

I have i site, which sends me json data, how can i parse it and use in plugin?
I have already checked Exolents JSON Include, but it's not working. Using his include i have to make json, and then decode(parse) it, but i already have json string stored in a buffer.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-23-2014 , 07:33   Re: Parse/Decode JSON
Reply With Quote #2

And this can't be used with json_decode() ? It seems it takes a string, so it should work.
__________________
Arkshine is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 04-23-2014 , 08:33   Re: Parse/Decode JSON
Reply With Quote #3

If exolent's include doesn't work, you can edit this module to read a string. It shouldn't be difficult.
https://forums.alliedmods.net/showthread.php?t=238340
__________________

Last edited by Neeeeeeeeeel.-; 04-23-2014 at 08:34.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 04-23-2014 , 11:15   Re: Parse/Decode JSON
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
And this can't be used with json_decode() ? It seems it takes a string, so it should work.
Can you post me example? I get tag mismatch. And there is no example how can i access data later on?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-23-2014 , 11:29   Re: Parse/Decode JSON
Reply With Quote #5

Well, all is written in .inc.

JSON:json_decode(const string[], &pos=0, len=0)

You get a tag mismatch, probably because you did not see function return is tagged with "JSON".
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode