I am trying to develop a script that find certain kinds of people and places in the United States.
I would like a script that does the following:
User enters a zip code, number of students threshold, crime index threshold, white percentage threshold, and high school search radius. Upon submission, the script uses Yahoo Yellow Pages ([login to view URL]) to search for:
a) VFW
b) Veterans of Foreign Wars
c) American Legion
d) Elks Lodge
e) Fraternal order of Eagles
f) Knights of Columbus
in that order for the zip code entered. You will notice that if you search for something within a city, Yahoo has a link that says "search beyond (city)" I'd like the script to use the beyond seach which results in all entries within 50 miles of the entered zip.
Each result from the Yahoo Search has a button labeled "map." When you click on this, the page contains the zip code of the search result. Using this new zip, I'd like the script to:
a) Search for high schools in the surrounding area by using this search:
[login to view URL]
The "zip" element in that URL will be replaced by the current zip and "miles" will be replaced by the radius specified by the user. One of the returned columns will be "students." Add up each result for the total number of students in the area (note: there can be more than 1 page of results here) If the number of students is equal to or greater than the entered student threshold, continue to:
Crime index:
Using the current zip, search:
[login to view URL]
The "csz" element here is the zip code. Look towards the bottom of the page, if the "total crime index" is less than or equal to the entered crime threshold, continue to:
Race search:
Using the current zip, search:
[login to view URL]
The results here show type of population. If the percent ratio of the "while alone" compared to "total population" is equal to or greater than the entered "white threshold," put the original Yahoo Search result for the establishment into an array in the following way:
Venue Name
Phone
Address
City, State, Zip
Number of high school kids
Crime index
White percentage
Output the array at the end.
If you have questions, please don't hesitate to ask.
Thanks you,
Evan