1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you pull up valid street names in a city using PHP?

Discussion in 'BlackHat Lounge' started by digitalpower, Dec 9, 2009.

  1. digitalpower

    digitalpower BANNED BANNED

    Joined:
    Dec 16, 2008
    Messages:
    303
    Likes Received:
    69
    Is there a way to pull up valid street names in a city that you specify using PHP?
     
  2. Crooker

    Crooker Newbie

    Joined:
    Jun 1, 2009
    Messages:
    0
    Likes Received:
    483
    Why don't you just use the google maps api?
     
  3. Crooker

    Crooker Newbie

    Joined:
    Jun 1, 2009
    Messages:
    0
    Likes Received:
    483
    Anyways i think i found a crued way of doing it.
    When you search for a street on google maps and it gets a result it will place on of these;
    [​IMG]
    on the map.

    So if it exist you get one of those.
    If it doesn't you don't get one of those.
    So i made this little snippet;
    It's searching for abbyroad in london.
    notice the comma in the url. So bassicly it's like you've written in the google maps search box "abbyroad,london" don't forget the comma in the url.
    The url says "abbyroad,+london" which you can obviously later change in "$var1,+$var2".
    Var 1 being street and var 2 being city
    Code:
    $homepage = file_get_contents ('http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=abbyroad,+london');
    
    if (preg_match('/class="mp iconA"/' , $homepage )){
    	echo "true";
    	}else{
    		echo "false";
    	}
    abbyroad exists so it echoes out true.