Is what there exists in French version?
It is difficult to modify this tcl?
I speak badly English, sorry...
.....................
Edited by Alchera
This Tcl is in English only as there is no function on the website it uses for any other language. Translating the contents of the script will do nothing as the output to the user will always be English.Azerty wrote:Is what there exists in French version?
It is difficult to modify this tcl?
I speak badly English, sorry...
# --------------------------------------------------------------------
# /////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#||||||||||||||||||||| IRC Horoscope Viewer ||||||||||||||||||||||||
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////
# --------------------------------------------------------------------
# By Ycarus (version 0.2B)
#
# Un très simple script permettant de voir son horoscope
# L'horoscope est récupéré à partir du site : http://www.abidjan.net
#
# Projet :
# - Téléchargement des horoscopes une fois par jour, sauf pour les 'biscuits de fortune' (ou alors les rajouter dans une base).
# - Ajout des horoscopes chinois ??
# - Ajout de quelques couleurs, gras, souligné,...
set chanactivelog "#divx"
# la commande est du style :!horoscope taureau
bind pub - !horoscope viewhoroscope
proc viewhoroscope { nick uhost handle chan arg } {
#date sous la forme 2002-02-19
#if {![string match $chan $chanactivelog]} { return 0 }
set arg [string tolower $arg]
if {[string length $arg] == 0} {
set tempfileprog "/home/yannick/temphoroscope.txt"
set urlduprog "http://www.abidjan.net/horoscope/cookie.asp"
set trucdebut [http::geturl $urlduprog -timeout 20000]
if {[::http::status $trucdebut] == "timeout"} {
putserv "PRIVMSG $chan : L'horoscope est indisponible... (TimeOut)"
}
set datadehtml [::http::data $trucdebut]
set finishhttp [http::Finish $trucdebut]
set fs [open $tempfileprog w]
puts $fs $datadehtml
close $fs
set horoscopefile [open $tempfileprog r]
set horoscope ""
set debhoros "0"
set count 0
while {![eof $horoscopefile]} {
gets $horoscopefile templine
incr count
if {$templine == " <font face=\"arial\" color=\"#FF0000\" size=\"2\">"} {
set debhoros [expr $count + 1]
}
if {$debhoros == $count} {
set horoscope [string range [string trim $templine] [expr [string first "<div align=\"center\">" $templine] + 6] [string length $templine] ]
}
}
close $horoscopefile
putserv "PRIVMSG $chan : Biscuit de fortune : $horoscope"
close $horoscopefile
} {
if {$arg == "bélier"} { set arg "belier" }
if {$arg == "gémeaux"} {set arg "gemeaux" }
if {$arg == "gémeau"} {set arg "gemeaux" }
if {$arg == "poisson"} {set arg "poissons" }
set tempfileprog "/home/yannick/temphoroscope.txt"
set urlduprog "http://www.abidjan.net/horoscope/traditionel/$arg.asp"
set trucdebut [http::geturl $urlduprog -timeout 20000]
if {[::http::status $trucdebut] == "timeout"} {
putserv "PRIVMSG $chan : L'horoscope est indisponible... (TimeOut)"
}
set datadehtml [::http::data $trucdebut]
set finishhttp [http::Finish $trucdebut]
set fs [open $tempfileprog w]
puts $fs $datadehtml
close $fs
set horoscopefile [open $tempfileprog r]
set horoscope ""
set debhoros "0"
set count 0
while {![eof $horoscopefile]} {
gets $horoscopefile templine
incr count
if {$templine == " <font size=\"2\" face=\"Arial\">"} {
set debhoros [expr $count + 1]
}
if {$debhoros == $count} {
set horoscope $templine
}
}
close $horoscopefile
set horoscope "$arg : $horoscope"
putlog "horoscope : $horoscope"
set horoscope2 ""
if {[string length $horoscope] > 455} {
set horoscopetempo [string range [string trim $horoscope] 390 455]
set lefirstpoint [expr [string first ". " $horoscopetempo] + 390]
set horoscope2 [string range [string trim $horoscope] [expr $lefirstpoint + 2] [string length $horoscope] ]
set horoscope [string range [string trim $horoscope] 0 $lefirstpoint]
}
putserv "PRIVMSG $nick : $horoscope"
if {$horoscope2 != ""} {
putserv "PRIVMSG $nick : $horoscope2"
}
}
}
putlog "********* Horoscope by Ycarus *******"