Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

How to interrupt JSON data


  • Please log in to reply
8 replies to this topic

#1 Kinhow

Kinhow

    Seeker

  • Active Members
  • 28 posts

Posted 06 June 2011 - 11:32 PM

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







#2 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 527 posts

Posted 06 June 2011 - 11:44 PM

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

#3 Kinhow

Kinhow

    Seeker

  • Active Members
  • 28 posts

Posted 06 June 2011 - 11:52 PM

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

#4 Kinhow

Kinhow

    Seeker

  • Active Members
  • 28 posts

Posted 07 June 2011 - 01:08 AM

Well I have found this:

http://www.autoitscript.com/forum/topic/103613-json-udf/page__p__736377__hl__json+data__fromsearch__1#entry736377

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


any ideas?

#5 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 527 posts

Posted 07 June 2011 - 01:47 AM

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

#6 Kinhow

Kinhow

    Seeker

  • Active Members
  • 28 posts

Posted 07 June 2011 - 04:11 AM

anyone have a code example on how to get this?

#7 Kinhow

Kinhow

    Seeker

  • Active Members
  • 28 posts

Posted 08 June 2011 - 01:55 AM

No one can give me a hand here?

#8 prakob

prakob

    Seeker

  • Active Members
  • 17 posts

Posted 13 June 2011 - 01:19 AM

Hi,

For that simple JSON you may use this JSON autoIt UDF. 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

#9 DelStone

DelStone

    Wayfarer

  • Active Members
  • Pip
  • 69 posts

Posted 06 February 2012 - 06:28 AM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users