Forums | MacLife
You are not logged in.
#1 2006-03-23 6:08 pm
Cutting apart another site with PHP?
I've been fooling around a bit with the Googlemaps API, but it would be a lot more useful if I could use addresses. Google doesn't supply that ability at the moment, so I've been having to use another website to convert the addresses into lat/long coords, and pasting those results into my site.
Basically, it's a huge hassle.
The addresses are posted to the geocoding site in the url. Is there a PHP trick I can use to download the source from this website to a variable in my own site? That way I could splice it up and get the lat/long variables automatically.
Example:
Visiting:
http://geocoder.us/demo.cgi?address=215 … ette%2C+IN
gives me a website with this in the source:
<td><h3>Latitude</h3></td>
<td>40.425197 °</td>
</tr>
<tr>
<td><h3>Longitude</h3></td>
<td>-86.904040 °</td>
I just want to swipe those location values. Any suggestions? I'm pretty good with PHP, but this situation is a little beyond me.
Offline
#2 2006-03-23 7:22 pm
Re: Cutting apart another site with PHP?
iZach004 wrote:
The addresses are posted to the geocoding site in the url. Is there a PHP trick I can use to download the source from this website to a variable in my own site?
Yes. But it's not nice. Especially since they provide multiple APIs to access the service, and give you several sample scripts for doing so. 
http://geocoder.us/help/
Offline
