You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more
I need to see the data that is being fed to the API from this site.
http://www.marinetraffic.com/ais/default.aspx?zoom=9&oldmmsi=13633757&olddate=10/11/2011%208:38:00%20AM
I think I should be able to see the data in XML somewhere but I am lost.
Have a look in here - might give you some answers?
http://www.marinetraffic.com/ais/aistraffic_v3.js
There's a fair few ajax calls going on in the abckend there.
Looks like its pullign XML for various different things, ie: ships, ports, tracks etc and the URL and params are different depending on what you're after.
start searching through the JS that xiphon linked to for 'downloadUrl' (which is a function call that's actually retrieving the data) to find the URLs for the ajax calls that are firing, and what parameters/variables are being set.
If you don't already have it install Firebug or similar for your browser of choice so you can start meddling with the calls in real time.
The Google maps API is actually quite easy to get to grips with, its working out how to feed it the right info that takes time.
Matt
Excellent thanks guys I think you have given me the information to answer the question. Your legends!
Its the tracks I need.
Got it thanks. The GetTracking function just gave me everything I needed 🙂
Assuming you've got google chrome, you can watch all the ajax calls being made.
Open the webpage in chrome
Use CTRL+SHIFT+I (or navigate to Current Page Control > Developer > Developer Tools. In the newer versions of Chrome, click the Wrench icon > Tools > Developer Tools.) to enable the Developer Tools.
From within the developer tools click on the Network button. If it isn't already, enable it for the session or always.
Click the "XHR" sub-button.
Initiate an AJAX call.
You will see items begin to show up in the left column under "Resources".
Click the resource and there are 2 tabs showing the headers and return content.
So when I press refresh I see calls to -
[url] http://www.marinetraffic.com/ais/getshipcountxml.aspx [/url]
[url] http://www.marinetraffic.com/ais/getjson.aspx?sw_x=-3&sw_y=50&ne_x=0&ne_y=52&zoom=9&fleet=&station=0 [/url]
[url] http://www.marinetraffic.com/ais/gettrackxml.aspx?mmsi=13633757&date= [/url]
[url] http://www.marinetraffic.com/ais/getareasxml.aspx [/url]
Glad you're sorted 🙂