Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/IP%2Dgeolocation?V=5
QUERY_STRINGV=5
CONTENT_TYPE
DOCUMENT_URI/revision/IP-geolocation
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
REMOTE_ADDR172.69.58.182
REMOTE_PORT18232
SERVER_PORT8888
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
HTTP_X_FORWARDED_FOR18.188.111.130
HTTP_CF_RAY88642fec6f4b1157-ORD
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP18.188.111.130
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

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