1 2 Previous Next 19 Replies Latest reply on Jan 28, 2017 12:07 AM by Nick Austen

    Script from FM to pull and parse a JSON file.

    peterbb

      Hello,

      In the past weeks I've posed questions here about connecting to an Oracle database with FM on my Mac. And, that took a few weeks, but, I finally managed to connect properly to that Oracle database. But, then, in a meeting today, the guy who built that database told me that I really shouldn't get my data by connecting directly to Oracle, but, rather, I should connect to the API of the application that sits on top of that database. So, that's what I'm doing now. I've proven to myself that I can use curl to grab the JSON file generated by that application. JSON, if you all don't know, is just an open source structured ASCII file, very common these days. And, curl is just an http clent. It's already there on my Mac, or any Mac. So, this is what I get:

       

       

      pb4072aiMac:~ pb4072a$ curl -G http://ps2000-graphics-prod.bna.com/api/images/im12334

      {"image_name":"im12334","alternate_text":null,"caption":null,"attribution":null,"last_updated_at":"2011-04-06T20:40:31.000-04:00","created_at":null,"pages":null,"height_picas":56.0,"width_picas":42.0,"renditions":[{"format":"pdf","size":111987,"last_updated_at":"2011-03-18T23:40:28.000-04:00","resolution":0,"pixel_depth":0,"link":"/api/rendition/show/380519/im12334"},{"format":"png","size":21504,"last_updated_at":"2011-04-06T20:40:31.000-04:00","resolution":0,"pixel_depth":1,"link":"/api/rendition/show/989593/im12334"},{"format":"tiff","size":86063,"last_updated_at":"2011-03-21T07:15:47.000-04:00","resolution":400,"pixel_depth":1,"link":"/api/rendition/show/587250/im12334"}],"keywords":[]}pb4072aiMac:~ pb4072a$

       

      I just need to know what kind of scripting I'm allowed to use in FM. Will it allow Ruby? Perl? JavaScript?

       

      Thanks,

      Peter

        1 2 Previous Next