| View previous topic :: View next topic |
| Author |
Message |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Thu Mar 04, 2010 4:29 am Post subject: updating http.tcl + old script [solved] |
|
|
Hi,
I guess this is the right place to post it since there's no way to contact author...
Updating http.tcl from v2.5.001 to 2.7.1, horoscope.tcl I'm using stopped working
How could it be fixed? (if I go back to older http.tcl, the script works again).
This is the short script
| Code: | # Reportar Errores a mi
# Aportes y actualizaciones seran bienvenidas =)
# Aguante las Tcls
bind pub - !horoscopo pub:horoscopo
proc pub:horoscopo {nick host hand chan arg} {
set arg [lindex $arg 0]
if {$arg==""} {
putserv "NOTICE $nick :4Usa: 14!horoscopo <signo>, 4Ej: 14!horoscopo aries"
return 0
}
switch [string tolower $arg] {
"aries" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=2"
} "tauro" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=19"
} "geminis" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=7"
} "cancer" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=3"
} "leo" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=10"
} "virgo" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=22"
} "libra" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=11"
} "escorpion" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=6"
} "sagitario" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=16"
} "capricornio" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=4"
} "acuario" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=1"
} "piscis" {
set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=14"
} default {
putserv "PRIVMSG $chan :4Signos validos: 14aries, tauro, geminis, cancer, leo, virgo,\
libra, escorpion, sagitario, capricornio, acuario y piscis."
}
}
set http [http::config -useragent mozilla]
set http [http::geturl $pagina -timeout [expr 1000 * 10]]
set html [http::data $http]
regexp {<span class="txt_2_10"><b></b><br>(.*)} $html horoscopo
regsub -all "<span class=\"txt_2_10\"><b></b><br>" $horoscopo "" horoscopo
regsub -all "<br></span>" $horoscopo "" horoscopo
putserv "PRIVMSG $chan :4[string toupper $arg]:14 $horoscopo"
}
|
Any help will be appreciated 
Last edited by Torrevado on Fri Mar 05, 2010 1:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Mar 04, 2010 1:49 pm Post subject: |
|
|
The only http.tcl version i know of is 2.5 and the script should still work with the newer versions, if there are any.
I'd recommend you look at the script (http.tcl) and check that its the correct one? _________________ TCL the misunderstood |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Fri Mar 05, 2010 4:53 am Post subject: |
|
|
@nml375: adding http:// fixed it.
@TCL_no_TK
| Quote: | | I'd recommend you look at the script (http.tcl) and check that its the correct one? |
| Code: | # http.tcl --
#
# Client-side HTTP for GET, POST, and HEAD commands. These routines can
# be used in untrusted code that uses the Safesock security policy. These
# procedures use a callback interface to avoid using vwait, which is not
# defined in the safe base.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.67.2.4 2008/08/11 21:57:14 dgp Exp $
package require Tcl 8.4
# Keep this in sync with pkgIndex.tcl and with the install directories
# in Makefiles
package provide http 2.7.1
|
Thank you both for helping  |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Mar 05, 2010 11:10 am Post subject: |
|
|
Thanks, I'm didn't know there was an other http.tcl  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|