Need to capture data returned to another Website

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dboyerco
    New Member
    • Jul 2007
    • 3

    Need to capture data returned to another Website

    I'm working with a company that is tracking my vihicle and they have an API that will allow me to log into their database and retrieve the location of my vihicle, which is returned to their website as an XML response.

    My question is: Is there way to get the data that is returned in the response so I can use that data on my website. I tried talking to them but they don't have any tech people there. Plus I would rather the response didn't show up on their website.

    Here is the code that they have on their website as an example:
    [HTML]<form method='post'
    action='https://www.sysdevx.com/api/GetAllVehicles. php'>
    <input type='text' name='login' value='your_log in' />
    <input type='text' name='password' value='your_pas sword' />
    <input type='submit'>
    </form>[/HTML]

    And the response is:

    [CODE=xml]<response>
    <status code="100" msg="Success"/>
    <vehicle serial="2002348 " date="117081392 4" lat="49.2520500 "
    lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y"
    speed="0" heading="0"/>
    <vehicle serial="2001452 " date="115765498 3" lat="49.2521320 "
    lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
    <vehicle serial="2001450 " date="116889089 2" lat="32.7947333 "
    lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123"
    speed="0" heading="-1"/>
    </response>[/CODE]
    Last edited by gits; Aug 1 '07, 06:06 AM. Reason: added CODE tags
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Yes, but you would need javascript to do that.

    Comment

    • dboyerco
      New Member
      • Jul 2007
      • 3

      #3
      Since you didn't post how to do it with JavaScipt I take it I need to move this question to that forum?

      Comment

      • dboyerco
        New Member
        • Jul 2007
        • 3

        #4
        Need to capture data returned to another Website

        I'm working with a company that is tracking my vihicle and they have an API that will allow me to log into their database and retrieve the location of my vihicle, which is returned to their website as an XML response.

        My question is: Is there way to get the data that is returned in the response so I can use that data on my website. I tried talking to them but they don't have any tech people there. Plus I would rather the response didn't show up on their website.

        Here is the code that they have on their website as an example:[code=html]
        <form method='post'
        action='https://www.sysdevx.com/api/GetAllVehicles. php'>
        <input type='text' name='login' value='your_log in' />
        <input type='text' name='password' value='your_pas sword' />
        <input type='submit'>
        </form>

        And the response is:
        <response>
        <status code="100" msg="Success"/>
        <vehicle serial="2002348 " date="117081392 4" lat="49.2520500 "
        lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y"
        speed="0" heading="0"/>
        <vehicle serial="2001452 " date="115765498 3" lat="49.2521320 "
        lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
        <vehicle serial="2001450 " date="116889089 2" lat="32.7947333 "
        lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123"
        speed="0" heading="-1"/>
        </response>[/code]
        Last edited by dboyerco; Jul 31 '07, 04:03 PM. Reason: Better Title

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          This is the html/css forum so, yes, I'll move it.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Merged duplicate threads.

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5388

              #7
              Originally posted by dboyerco
              ...
              And the response is:

              [CODE=xml]<response>
              <status code="100" msg="Success"/>
              <vehicle serial="2002348 " date="117081392 4" lat="49.2520500 "
              lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y"
              speed="0" heading="0"/>
              <vehicle serial="2001452 " date="115765498 3" lat="49.2521320 "
              lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
              <vehicle serial="2001450 " date="116889089 2" lat="32.7947333 "
              lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123"
              speed="0" heading="-1"/>
              </response>[/CODE]
              hi ...

              you may parse through the response with javascript's dom-methods, for example:

              [CODE=javascript]// get a reference to the response-node
              var response = document.getEle mentsByTagName( 'response')[0];

              // get the values you want from the first child-node
              var vehicle1_serial = response.childN odes[0].getAttribute(' serial');[/CODE]

              so you see that you may loop through the childNodes-list and get the interesting things out of the nodes with getAttribute ;)

              kind regards

              Comment

              Working...