6 Replies Latest reply on Jan 3, 2013 6:38 PM by nickorr

    Plugin to Get JSON Text?

    EdwardMcPikeJr

      Hi all:

       

      Just curious if anybody could help me figure out how to automate the following in FileMaker.

       

      I am currently using a Firefox plugin (Firebug) to access JSON files downloaded for a Flash site. I right-click on the JSON data and copy the raw text, then paste it into a text field in the database. I then loop through the text, parsing the data I need and placing it into the proper records.

       

      Since I have the URL for each event, I was hoping to automate grabbing the JSON text - loop through records in the database and grab the JSON text automatically for each event. It's in a file returned from a POST call.

       

      Thanks for your help!

       

      Regards,


      Ed

        • 1. Re: Plugin to Get JSON Text?
          nickorr

          Ed,

           

          Do you have a url for the json data, or is it part of the flash?  If you can find out from the source code a url for the json data, then paste that into a browser and see if you get anything.

           

          If it's a url you can access, then if it's a v12 solution you can probably use the InsertFromURL script step.  If it's not a GET operation or you need more than just a URL you could use our free BaseElements plugin : http://www.goya.com.au/baseelements/plugin  If you need more than that, the Troi URL is a great full featured plugin.

           

          Once it's then in as text you can process it however you like.

           

          Cheers,

          Nick

          • 3. Re: Plugin to Get JSON Text?
            monkeybreadsoftware

            Our MBS Plugin has functions for JSON and functions to download URL with CURL functions.

             

            see

            http://www.monkeybreadsoftware.de/filemaker/

             

            Greetings

            Christian

            • 4. Re: Plugin to Get JSON Text?
              EdwardMcPikeJr

              Thanks for your responses Nick, Draco, and Christian.  Sorry for my delayed response.  I got buried in the Holidays and such.

               

              Regards,

               

              Ed

              • 5. Re: Plugin to Get JSON Text?
                EdwardMcPikeJr

                I guess my problem is that I don't know if I can retrieve the needed JSON text via URL.  I can get the text manually, paste it into my text field, then parse it.  Parsing it is not the problem - that's the easy part.

                 

                This is a Facebook App.  It displays a list of matches, and who won.  So I have an Event ID for each event.  Some events have 20 matches, some have a lot more, but that's not a big deal.  I put the Event URL into  my database, click a button and it opens the page in my Firefox browser.  I already have a Firefox plugin open - Firebug.  So it has a frame-like window open in the bottom that lists cache requests.

                 

                One of those requests is a POST, and it doesn't return HTML, but returns JSON.  So I go to this request in the Firebug list and copy the JSON and paste it into my solution.

                 

                What I'd like to do is simply get the JSON with a POST URL function.  I don't think any of these mentioned will return the JSON - I think they're just going to return the HTML.  On top of that, I need to somehow be logged into my Facebook account when this is running.

                 

                Any ideas how to get the JSON text through one of the many Get URL functions?

                 

                Regards,

                 

                Ed

                • 6. Re: Plugin to Get JSON Text?
                  nickorr

                  Ed,

                   

                  Without seeing the details of the original urls, and the content and the data you're getting it's hard to say.  But generally, all web pages ( including references to json data ) are just url calls that contain other url calls.  So you might start on one page, but that page contains another url call somewhere in it to the url for the json data.  Sometimes you can find this simply enough by looking at the source code of the main page.  Other times, it's calculated or generated dynamically and is harder to find.

                   

                  But, even if you do find the url, getting it to produce data may be difficult.  It may only work in the context of that page, or may require login or other auth details.  If it's within facebook, then you've got more issues about facebook's api and auth to deal with.  Then within that querying the specific app that you want to access.

                   

                  I'd contact the app developer to see if they can assist you with those details.  They may be able to point you in the right direction, and then you only have facebook auth to deal with.

                   

                  Cheers,

                  Nick