• Beta Platinum

    Hi,

    I have been investigating the GET function of the TCP/IP Send Data, TCP Stream Control and TCP In Watcher actors for a project about environmental concerns/crisis. Thanks to @DusX for the introductory tutorial. The tutorial is very helpful even though it has seen some years now, it still points everything in the right direction. I was able to access very pertinent data sets from The World Bank. They have data on poverty and climate change for each country so it is a very useful resource for global statistics. I was really thankful when it appeared I could pull that live data straight into an Isadora patch and put it to work to start to tell a visual story. 

    In the end I could only get so far with parsing the data through the TCP In Watcher before it just seemed to not want to allow any more. In fact I struggled to get the simplest full data set to pass through the module. I know! greater minds than mine would have made short work of it. And so I am here looking all of that data flowing into the TCP/IP backend 'monitor' of Isadora. But it appears I am unable to get it out onto the stage. Any words of wisdom or advice would be warmly welcomed. The patch-in-progress is attached and it should be live with The World Bank data connection if your machine is online.

    WorldBank GET Data test.izz

    recording of data flow


    It's crazy I know.

    Best Wishes

  • Beta Platinum

    @bonemap

    OK I know I am reply to myself here but... I have got the syntax much better to pass the data from the World Bank. This represents a prototype that I hope will unlock the more relevant data available about poverty and climate change. If you are interested in having a look at the solution the following patch represents a working prototype for a general dataset of country by country information.

    WorldBank GET Data test v.2.izz


    Best Wishes and thanks for listening!

  • Tech Staff

    Looks like you have made great progress with TCP In, it can be a process to get things working exactly as you require since these actors are very general purpose.

    Since it looks like you are grabbing data from a JSON based api, its likely that the URL itself is how specific data is selected.
    If that is true, you may be able to just directly grab the JSON data using the 'Get URL Text' actor.
    I just tested with 'http://api.worldbank.org/v2/co...' and its working great.
    Its then rather easy to parse the JSON in Javascript. Details here: https://www.w3schools.com/js/j...

    Hopefully this is an easier and more reliable method for you.

  • Beta Platinum

    @dusx said:

    'Get URL Text' actor.I just tested with 'http://api.worldbank.org/v2/co...' and its working great.Its then rather easy to parse the JSON in Javascript. Details here: https://www.w3schools.com/js/j...

     Hey Ryan,

    Thank you for the advice. I will look into that. Great information.

    Best wishes

  • Beta Platinum

    @dusx said:

    grab the JSON data using the 'Get URL Text' actor

     Hi @DusX,

    After your suggestion I have refocused this experimental development using the 'Get URL Text' actor as you have suggested. It has worked handsomely to bring online data into the Isadora patch environment. I have made a patch with detailed annotations about the process and offer it here as a departure point for those artists who are seeking to establish using dynamic data from a URL source in their projects. 

    Dynamic data demonstration file (using data from online sources) Dynamic Data Isadora project

    This Isadora patch accesses live data from an online source. It uses it in a way that represents the data graphically and to locate elements in x and y space on the stage. The patch works by accessing an Open Data Source using a live internet URL. The data set includes names of Countries, their Capital City and Latitude and Longitude coordinates and other information. After scaling with Limit-Scale Value actors, the longitude and latitude data locates each city on a world map. A list of iso2 codes (2 letter country codes) has been saved as a text file and read into the patch through a Data Array actor. This Isadora patch demonstrates the Get URL Text, Text Parser, Text Formatter and Data Array actors.



    Best Wishes

    Russell