Delphi: Retrieve city from public ip address -
how city name http://whatismyipaddress.com/ website? this attempt: var sl: tstringlist; a: integer; s: string; begin sl := tstringlist.create; try httpgettext('http://whatismyipaddress.com/', sl); := pos('your ip address is', sl.text); if > 0 begin s := copy(sl.text, a, 40); := pos('</', s); s := copy(s, 19, - 19); ip := s; end else ip := 'unknow ip'; freeandnil(sl); end; is way without use synapse library changing (httpgettext) (idhttp1.get) ? thanks me! you have download html content whatismyipaddress.com generates, , parse html needed. can use http client (indy, ics, synapse, curl, wininet/winhttp, raw winsock calls, etc) download html. city appears once in html, inside table, eg: <tr><th style="font-weight:bold;color:#676769;">city:</th><td style="font-size:14px;">name here</td></tr> so s