Sign in to follow this  
Followers 0

How to interrupt JSON data

9 posts in this topic

Posted

Hi all...

I would like to know if there is a way to get the data returned from a JSON with autoit...

theres a facebook app that keep the ranking of my friends that use the app... and I would like to collect that info.

The HTML returned is like this:

{"data":[{"name":"person1","id":"10000134175"},{"name":"person2","id":"100007632174"},{"name":"person3","id":"1781959766"},{"name":"person4","id":"1000050686112"},{"name":"person5","id":"15320403"}]}

Is there a way to do that using the _IE include?

Thanks in advance...

Share this post


Link to post
Share on other sites



Posted

Search the forums for a JSON reader/getter/interpreter/thingy. Im pretty sure I have seen one floating around.

Failing that, you will need to declare an array to hold your friend data. Then, you will need to 'walk' the data, populating the array with the names and 'rankings' of your friends. If the JSON data becomes nested at anypoint you will need to use recursion.

I wrote something similar to this a year ago. My version walked my friends list and their friends list...etc going outwards indexing everyone, just for lolz. Got to about 50,000 people when It finally crashed. Script doesnt work anymore due to changes in FB graph API.

Share this post


Link to post
Share on other sites

Posted

Thanks man, I will try searching those terms... I tryed searching for interrupting and data and didnt get anything....

btw having the string or array I know what to do, just need to know how to actually grab that info....

Share this post


Link to post
Share on other sites

Posted

Well I have found this:

But anyway, I need to know how to receive those GETS...

any ideas?

Share this post


Link to post
Share on other sites

Posted

no idea sorry,

I just wrote a custom handler back in the day that went through the data character by character.

Share this post


Link to post
Share on other sites

Posted

anyone have a code example on how to get this?

Share this post


Link to post
Share on other sites

Posted

No one can give me a hand here?

Share this post


Link to post
Share on other sites

Posted

Hi,

For that simple JSON you may use this No offense, but I don't think there will be a fully valid JSON UDF for now. AutoIt just lag of many important features to make a good parser. Some of that many features are object and null data type and nested array. You may try using AutoIt to call the lib or exec in www.json.org. Get the result you want to AutoIt to finish the automate task. Actually, It will be much easier if AutoIt developers would decide to add JSON support, there are already many open source C/C++ code out there but what would make it hard for them to decide is the support in various areas like data types and OO.

Prakob

Share this post


Link to post
Share on other sites

Posted

I know it's a bit late, (it may help someone else) - is this what you're looking for?

$json = ObjCreate("Microsoft.XMLHTTP")
  $json.Open("GET", $url & "&access_token=" & $Token, 0)
  $json.Send
                $result = $json.responseText

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.