Social Miner Post status query app

Version 1

    Subject: RE: Social Miner Post status query app
    Replied by: John Russell on 08-03-2012 01:18:35 PM
    You can just have some javascript that runs on the page that uses setTimeout or setInterval to periodically check. It can all be done on the client side.

    http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

    Subject: RE: Social Miner Post status query app
    Replied by: John Russell on 08-03-2012 03:30:35 PM
    Jquery has ways of making simple requests and letting you parse the response.  Check out here.

    http://api.jquery.com/jQuery.get/
    This document was generated from CDN thread

    Created by: Andrew Fraser on 08-03-2012 12:06:52 PM
    Hello all,
     
    I am looking to write an app that adds a post to SM and then queries the status periodically of that post to determine the status.  I have a simple piece of HTML here for the post:
     
    <HTML>
    <head>
    <title>SME Request</title>
    </head>
    <BODY>
    <FORM NAME="myform" ACTION="http://10.233.141.19/ccp-webapp/ccp/pushfeed/100008" METHOD="GET">
    Request an Expert: <BR>
        <input type="hidden" id='title' type='text' value="SME-Request" name='title' />
        <input type="hidden" id='author' type='text' value="ING" name='author' />
        <input type="hidden" id='description' type='text' value="SME-Request" name='description' />
        <input type="hidden" id='tags' type='text' value="sme" name='tags' />
        <input type="hidden" id='remarks' type='text' name='extensionField_remarks' value='sample value' />
        <INPUT TYPE="submit" NAME="button" Value="submit">
    </FORM>
    </BODY>
    </HTML>
     
    This returns the contact ID.  I want to take the contact ID e.g.
    <pre>http://10.233.141.19/ccp-webapp/ccp/socialcontact/F34445D5100001350000A8540AE98D13

    And then poll this URL every 3 seconds to determine the "status" variable. 

    IF status is handled then perform popup to say "contact is handled" else perform pop up to state "please wait for an SME"


    Has anyone done anything similar already that I could steal this from?!!!!  I am thinking that this needs to be a bit of AJAX in HTML/Jscript that calls a JSP?  Right?

    Thanks in advance,
    Andrew
    </pre>

    Subject: RE: Social Miner Post status query app
    Replied by: Andrew Fraser on 08-03-2012 02:33:33 PM
    Hi John - thanks for the speedy reply...this is great if I can do it in Javascript..and I get that the settimer can manage polling of the URL but how to I receive and parse the HTTP response in client javascript?  I.e. I make the original HTTP GET of the form to create a social contact but how do I receive the response (firstly the social contact ID and with the later GET the "status" of the contact that is returned in XML) when running the app from a client browser in javascript?

    Thanks - and sorry if this is a stupid question!
    Andrew