Jump to content

How to interrupt JSON data


Recommended Posts

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...

Link to comment
Share on other sites

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.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

no idea sorry,

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

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 7 months later...

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...