php - Google MAP HTTP request or API -


I would like to get information from one location to another using Google Maps.

I have

Although the above link is based on the geographic code I would like to use the zip code if possible.

But I really like to get through a time as Php call is currently working in the backend and not for the client show. Can I make such requests through HTTP request?

For example

FROM zip: 98010

To zip: 98011

Just issue this HTTP request:

  http://maps.google.com/maps?saddr = 98010 & amp; Daddr = 98011 and output = html & amp; Oi = nojs  

then parse the response to div with class = dditd and id = dditd and this division gives you all the information needed in the traffic (distance, time of travel, time of travel time). It can be done through RegEx or XPath or whatever you want. / P>

After receiving the information, you should still change the "text representation" (such as 50mins / 1hour 12 mins / 1day 1hour / ...) in any number, such as the DB field.

  & lt; Div class = dditd id = dditd> & Lt; Div & gt; & Lt; B & gt; 38.1 & amp; nbsp; # 160; Mi and lieutenant; ; / B & gt; & Amp; # 8211; About & lt; B & g t; 53 minutes & lt; / B & gt; & Lt; Span class = traffictime & gt; & Amp; Nbsp; (Up to 1 hour 30 minutes in traffic) & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

But keep in mind that the given time is not really accurate because the zip code can be a big geographic area and I do not know from which point Google actually does the solution.

Therefore, the given time can be isolated from the individual zodiac, depending on the actual beginning and destination points.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -