Listing 1

<cfscript>
citystart 	= find('CITY: ',cfhttp.filecontent)+6;
cityend 	= find('<br>',cfhttp.filecontent,citystart);
city 		= mid(cfhttp.filecontent,citystart,cityend-citystart);
statestart 	= find('STATE: ',cfhttp.filecontent)+7;
stateend 	= find('<br>',cfhttp.filecontent,statestart);
state 		= mid(cfhttp.filecontent,statestart,stateend-statestart);
countrystart 	= find('COUNTRY: ',cfhttp.filecontent)+9;
countryend 	= find('<br>',cfhttp.filecontent,countrystart);
country 	= mid(cfhttp.filecontent,countrystart,countryend-countrystart);
latstart 	= find('LAT: ',cfhttp.filecontent)+4;
latend 		= find('<br>',cfhttp.filecontent,latstart);
lat 		= mid(cfhttp.filecontent,latstart,latend-latstart);
longstart 	= find('LONG: ',cfhttp.filecontent)+5;
longend 	= find('<br>',cfhttp.filecontent,longstart);
long 		= mid(cfhttp.filecontent,longstart,longend-longstart);
</cfscript>


Listing 2

<script type="text/javascript">
  //<![CDATA[
  var map = new GMap(document.getElementById("map"));
  map.addControl(new GLargeMapControl());
  // adds control for panning/zooming
  map.addControl(new GMapTypeControl());
  // adds control for switching between Map & Satellite Mode
  map.centerAndZoom(new GPoint(-74.04, 40.32), 15);
  // draws map centered at this point - last parameter is zoom level which can be from 1 (street
  level) to 17

  <cfloop query="getIPs">
  <cfhttp 
url="http://netgeo.caida.org/perl/netgeo.cgi?target=#ipaddress#"></cfhttp>

<!--- INCLUDE PARSING CODE FROM LISTING 1 HERE --->

<!--- EACH MARKER MUST BE UNIQUE SO WE'LL USE #CURRENTROW# BELOW TO MAKE THEM UNIQUE --->
  var point = new GPoint(#trim(long)#,#trim(lat)#);
  var marker#currentRow# = new GMarker(point);
  var html#currentRow# = "#city#, #state# #country#";
  // sets HTML for popup balloon
  GEvent.addListener(marker#currentRow#, "click", function() { 
  marker#currentRow#.openInfoWindowHtml(html#currentRow#); });
  // adds popup event to marker
  map.addOverlay(marker#currentRow#);
  // plot marker on map
  </cfloop>

  //]]>
</script>