Connecting Tech Pros Worldwide Forums | Help | Site Map

Need to capture data returned to another Website

Newbie
 
Join Date: Jul 2007
Location: Loveland, Co
Posts: 3
#1: Jul 31 '07
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_login' />
<input type='text' name='password' value='your_password' />
<input type='submit'>
</form>[/HTML]

And the response is:

Expand|Select|Wrap|Line Numbers
  1. <response>
  2. <status code="100" msg="Success"/>
  3. <vehicle serial="2002348" date="1170813924" lat="49.2520500" 
  4.   lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y" 
  5.   speed="0" heading="0"/>
  6. <vehicle serial="2001452" date="1157654983" lat="49.2521320" 
  7.   lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
  8. <vehicle serial="2001450" date="1168890892" lat="32.7947333" 
  9.   lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123" 
  10.   speed="0" heading="-1"/>
  11. </response>

drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,566
#2: Jul 31 '07

re: Need to capture data returned to another Website


Yes, but you would need javascript to do that.
Newbie
 
Join Date: Jul 2007
Location: Loveland, Co
Posts: 3
#3: Jul 31 '07

re: Need to capture data returned to another Website


Since you didn't post how to do it with JavaScipt I take it I need to move this question to that forum?
Newbie
 
Join Date: Jul 2007
Location: Loveland, Co
Posts: 3
#4: Jul 31 '07

re: 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:
Expand|Select|Wrap|Line Numbers
  1. <form method='post' 
  2. action='https://www.sysdevx.com/api/GetAllVehicles.php'>
  3. <input type='text' name='login' value='your_login' />
  4. <input type='text' name='password' value='your_password' />
  5. <input type='submit'>
  6. </form>
  7.  
  8. And the response is:
  9. <response>
  10. <status code="100" msg="Success"/>
  11. <vehicle serial="2002348" date="1170813924" lat="49.2520500" 
  12. lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y" 
  13. speed="0" heading="0"/>
  14. <vehicle serial="2001452" date="1157654983" lat="49.2521320" 
  15. lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
  16. <vehicle serial="2001450" date="1168890892" lat="32.7947333" 
  17. lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123" 
  18. speed="0" heading="-1"/>
  19. </response>
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,566
#5: Jul 31 '07

re: Need to capture data returned to another Website


This is the html/css forum so, yes, I'll move it.
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#6: Jul 31 '07

re: Need to capture data returned to another Website


Merged duplicate threads.
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,134
#7: Aug 1 '07

re: Need to capture data returned to another Website


Quote:

Originally Posted by dboyerco

...
And the response is:

Expand|Select|Wrap|Line Numbers
  1. <response>
  2. <status code="100" msg="Success"/>
  3. <vehicle serial="2002348" date="1170813924" lat="49.2520500" 
  4.   lng="-123.1108800" type="18" address="271 W 21st Ave, Vancouver, BC, V5Y" 
  5.   speed="0" heading="0"/>
  6. <vehicle serial="2001452" date="1157654983" lat="49.2521320" 
  7.   lng="-123.1111760" type="17" address="" speed="0" heading="0"/>
  8. <vehicle serial="2001450" date="1168890892" lat="32.7947333" 
  9.   lng="-117.1367500" type="0" address="8999 Gowdy Ave, San Diego, CA, 92123" 
  10.   speed="0" heading="-1"/>
  11. </response>

hi ...

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

Expand|Select|Wrap|Line Numbers
  1. // get a reference to the response-node
  2. var response = document.getElementsByTagName('response')[0];
  3.  
  4. // get the values you want from the first child-node
  5. var vehicle1_serial = response.childNodes[0].getAttribute('serial');
so you see that you may loop through the childNodes-list and get the interesting things out of the nodes with getAttribute ;)

kind regards
Reply