Error processing request
Parameters
CONTENT_LENGTH | 0 |
REQUEST_METHOD | GET |
REQUEST_URI | /revision/IP%2Dgeolocation?V=5 |
QUERY_STRING | V=5 |
CONTENT_TYPE | |
DOCUMENT_URI | /revision/IP-geolocation |
DOCUMENT_ROOT | /var/www/nikit/nikit/nginx/../docroot |
SCGI | 1 |
SERVER_PROTOCOL | HTTP/1.1 |
REMOTE_ADDR | 172.69.58.182 |
REMOTE_PORT | 18232 |
SERVER_PORT | 8888 |
SERVER_NAME | wiki.tcl-lang.org |
HTTP_HOST | wiki.tcl-lang.org |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_X_FORWARDED_FOR | 18.188.111.130 |
HTTP_CF_RAY | 88642fec6f4b1157-ORD |
HTTP_X_FORWARDED_PROTO | http |
HTTP_CF_VISITOR | {"scheme":"http"} |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected]) |
HTTP_CF_CONNECTING_IP | 18.188.111.130 |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_IPCOUNTRY | US |
Body
Error
Unknow state transition: LINE -> END
-code
1
-level
0
-errorstack
INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit IP-geolocation {'''Example of getting geolocation information of IP's via free ipinfodb service'''
The code below is run from the command line with the ip as argument.
======
#!/bin/tclsh
package require http
package require JSONRPC
set ip $argv
puts "get geo data from $argv"
#get the desired data
set ht [::http::geturl http://ipinfodb.com/ip_query.php?output=json&timezone=false&ip=$ip]
set geo_ip [json::json2dict [::http::data $ht]]
::http::cleanup $ht
# some sample processing stuff
if {[dict get $geo_ip Status] == "OK"} {
foreach key [dict keys $geo_ip] {
set value [dict get $geo_ip $key]
if {$value != ""} {
puts "$key => $value"
}
}
}
======
Sample session:
===
rob@rob-desktop:~/Public$ ./ip-geo 70.85.16.128
get geo data from 70.85.16.128
Ip => 70.85.16.128
Status => OK
CountryCode => US
CountryName => United States
RegionCode => 48
RegionName => Texas
City => Houston
ZipPostalCode => 77002
Latitude => 29.7523
Longitude => -95.367
===
======
you can also do this easily using the tcllib rest module
package require rest
set geoip(lookup) {
url http://ipinfodb.com/ip_query.php
req_args { ip: }
static_args { output json timzone false }
}
rest::create_interface geoip
array set out [geoip::lookup -ip 70.85.16.128]
parray out
<<categories>>Category Internet | Category Data Serialization Format} regexp2} CALL {my render IP-geolocation {'''Example of getting geolocation information of IP's via free ipinfodb service'''
The code below is run from the command line with the ip as argument.
======
#!/bin/tclsh
package require http
package require JSONRPC
set ip $argv
puts "get geo data from $argv"
#get the desired data
set ht [::http::geturl http://ipinfodb.com/ip_query.php?output=json&timezone=false&ip=$ip]
set geo_ip [json::json2dict [::http::data $ht]]
::http::cleanup $ht
# some sample processing stuff
if {[dict get $geo_ip Status] == "OK"} {
foreach key [dict keys $geo_ip] {
set value [dict get $geo_ip $key]
if {$value != ""} {
puts "$key => $value"
}
}
}
======
Sample session:
===
rob@rob-desktop:~/Public$ ./ip-geo 70.85.16.128
get geo data from 70.85.16.128
Ip => 70.85.16.128
Status => OK
CountryCode => US
CountryName => United States
RegionCode => 48
RegionName => Texas
City => Houston
ZipPostalCode => 77002
Latitude => 29.7523
Longitude => -95.367
===
======
you can also do this easily using the tcllib rest module
package require rest
set geoip(lookup) {
url http://ipinfodb.com/ip_query.php
req_args { ip: }
static_args { output json timzone false }
}
rest::create_interface geoip
array set out [geoip::lookup -ip 70.85.16.128]
parray out
<<categories>>Category Internet | Category Data Serialization Format}} CALL {my revision IP-geolocation} CALL {::oo::Obj1899229 process revision/IP%2Dgeolocation} CALL {::oo::Obj1899227 process}
-errorcode
NONE
-errorinfo
Unknow state transition: LINE -> END
while executing
"error $msg"
(class "::Wiki" method "render_wikit" line 6)
invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
(class "::Wiki" method "render" line 8)
invoked from within
"my render $name $C"
(class "::Wiki" method "revision" line 31)
invoked from within
"my revision $page"
(class "::Wiki" method "process" line 56)
invoked from within
"$server process [string trim $uri /]"
-errorline
4