egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

updating http.tcl + old script [solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Thu Mar 04, 2010 4:29 am    Post subject: updating http.tcl + old script [solved] Reply with quote

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 Crying or Very sad

Quote:
Tcl error [pub:horoscopo]: Unsupported URL: www.terra.cl/astrologia/include/pop_h_diario.cfm?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:
# 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 Smile


Last edited by Torrevado on Fri Mar 05, 2010 1:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Mar 04, 2010 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 04, 2010 2:04 pm    Post subject: Reply with quote

Have you tried adding http:// to the url's?
Such as http://www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=19
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Fri Mar 05, 2010 4:53 am    Post subject: Reply with quote

@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 Smile
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Mar 05, 2010 11:10 am    Post subject: Reply with quote

Thanks, I'm didn't know there was an other http.tcl Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber