Jump to content

getting data from an api


rempires

Recommended Posts

so for BPA(some high school competition thing) I'm the leader of the web app team.  Well we have to make a travel site for the city of Chicago, people plan a schedule and all that... I thought it would be kinda cool to also give people directions from there last location to there next location based on what they put on there schedule. ex. museum of sceince, next pizza at nemo's.  so i'd then use mapquest api to generate the directions turn by turn for that person.  Well this is no problem i got this my question is a very broad one and if you have any q's for me ask and i'll tell you what i can.

 

I need to get the data the map quest api returns.  when you look at the page source code there is nothing, so it's not actually sending the page back any data... that's a problem. i was gonna use php to extract the data that i needed from there and format it my own way right onto there schedule. i can't sue what map quest gives me because it's to big and clunky and i don't want the map or anything.

 

does anyone have any idea how i could accomplish this goal? if you need a better description, code(of the little i have), or anything else please feel free to ask and i will answer.

 

here is really the only code related to this q i can think of to provide, it's basicly the mapqust example scrip to, but simplified/cut down more.

<script src="http://web.openapi.mapquest.com/oapi/transaction?request=script&key=My Key To Use The API"  type="text/javascript"></script>

<script type="text/javascript">
function doSubmit()
	{
		mqRoute = new MQRoute("container");

		var form = document.getElementById("routeInfo");


		var overviewSize = new MQSize();
		overviewSize.setHeight(400);
		overviewSize.setWidth(600);

		mqRoute.primaryMapSize = overviewSize;

		mqRoute.origin.setAddress(form.elements.namedItem("1a").value);
		mqRoute.origin.setCity("Chicago");
		mqRoute.origin.setStateProvince("IL");
		mqRoute.origin.setPostalCode(form.elements.namedItem("1z").value);
		mqRoute.origin.setName("orig");

		mqRoute.destination.setAddress(form.elements.namedItem("2a").value);
		mqRoute.destination.setCity("Chicago");
		mqRoute.destination.setStateProvince("IL");
		mqRoute.destination.setPostalCode(form.elements.namedItem("2z").value);
		mqRoute.destination.setName("dest");

		mqRoute.doRoute("routeReturn");
	}
</script>

<div id='container' class='mqContainer' style='height:400px;width:600px'>

 

the direction and pic go into the div container but no actual code is inserted... i need to pull the data out of what it inputs.

john

 

Link to comment
Share on other sites

Does anyone have any ideas of how i could do this or a way of doing this using a different product?? i believe that mapquest is sending the data through something called DOM, I'm unfamiliar which what this is though and will have to look it up if that helps anyone (i was using firebug and saw a lot of info listed there).

 

any ideas at all of how to do this or another way of doing this would be greatly appreciated.

 

john

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.