This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

updating http.tcl + old script [solved]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

updating http.tcl + old script [solved]

Post by Torrevado »

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 :cry:
Tcl error [pub:horoscopo]: Unsupported URL: www.terra.cl/astrologia/include/pop_h_d ... m?signo=19
How could it be fixed? (if I go back to older http.tcl, the script works again).

This is the short script

Code: Select all

# 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.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

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?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Have you tried adding http:// to the url's?
Such as http://www.terra.cl/astrologia/include/ ... m?signo=19
NML_375
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

@nml375: adding http:// fixed it.
@TCL_no_TK
I'd recommend you look at the script (http.tcl) and check that its the correct one?

Code: Select all

# 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 :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Thanks, I'm didn't know there was an other http.tcl :)
Post Reply