Quantcast

Forums | MacLife

You are not logged in.

#1 2006-03-23 6:08 pm

iZach004
Member
From: Indianapolis, IN, 46240
Registered: 2001-06-04
Posts: 176
Website

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 &deg;</td>
</tr>
<tr>
    <td><h3>Longitude</h3></td>

    <td>-86.904040 &deg;</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

Miles
Now I fight for wisdom!
Administrator
From: Michigan
Registered: 2001-07-21
Posts: 4506
Website

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. smile

http://geocoder.us/help/

Offline

 

#3 2006-03-24 8:03 am

iZach004
Member
From: Indianapolis, IN, 46240
Registered: 2001-06-04
Posts: 176
Website

Re: Cutting apart another site with PHP?

Ah...

So I see...

Thanks....


I mean, I realized that all along.... I just, you know, I just wanted to make my life a lot harder...

Offline

 

Board footer

Powered by PunBB 1.2.6
© Copyright 2002–2005 Rickard Andersson