By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,540 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Need to capture data returned to another Website

P: 3
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>
Jul 31 '07 #1
Share this Question
Share on Google+
6 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Yes, but you would need javascript to do that.
Jul 31 '07 #2

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

P: 3
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>
Jul 31 '07 #4

drhowarddrfine
Expert 5K+
P: 7,435
This is the html/css forum so, yes, I'll move it.
Jul 31 '07 #5

pbmods
Expert 5K+
P: 5,821
Merged duplicate threads.
Jul 31 '07 #6

gits
Expert Mod 5K+
P: 5,369
...
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
Aug 1 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.