Locate IP with info on Country, City and ISP

By independentt on Mar 11, 2014

The title says it all.
Contains $htmlfree by Freckle ::Thumbs up!::

;               USAGE: /resolve <ip> 

alias resolve {
  set %resolve.ip $$1
  sockopen resolve.ip_ $+ $$1 www.topwebhosts.org 80
}
on *:sockopen:resolve.ip*: {
  var %a = sockwrite -n $sockname
  %a GET $+(/tools/ip-locator.php?query=,%resolve.ip) HTTP/1.1
  %a HOST: www.topwebhosts.org
  %a $crlf
}
on *:sockread:resolve.ip*: {
  window -e @resolve
  sockread %sockread
  %sockread = $htmlfree(%sockread)
  if (*IP*AddressCountryRegionCityISP*.*.*.* iswm %sockread) { 
    set %resolved $remove($gettok(%sockread,3-4,20),$chr(20))
    echo @resolve %resolved
    sockclose $sockname
  }
}
alias -l htmlfree {
  var %x, %i = $regsub($replace($1-,<td>,$chr(32),<tr>,$chr(20),<br>,$chr(20)),/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}

Comments

Sign in to comment.
Arigateaux   -  Mar 12, 2014

The popular $noHTML, as used on zigwap.com

alias noHTML return $regsubex($1, /<[^>]+(?:>|$)|^[^<>]+>/g, $null)
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.