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.

[SOLVED] horoscop tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
w
while
Voice
Posts: 34
Joined: Sat Jul 11, 2009 9:05 am
Location: beat mort

[SOLVED] horoscop tcl

Post by while »

hello. i have this tcl but it seems that it stopped working.. i think the site from which it grabbed the data change.
here it is:

Code: Select all

package require http
bind pub -|- !horoscop check:zodie

proc check:zodie {nick host hand chan arg} {
global check:zodie

if {![channel get $chan horoscop]} {puthelp "NOTICE $nick :FAILED: Horoscop isn`t set. Try !chanset +horoscop"; return}

set arg [lindex $arg 0]
if {$arg == "" || ![regexp {^(berbec|taur|gemeni|rac|leu|fecioara|balanta|scorpion|sagetator|capricorn|varsator|pesti)$} $arg]} {
putserv "NOTICE $nick :Foloseste: !horoscop <semn zodiacal>"
return 0
}
set pagina "http://www.zodii.ro/zodiac/$arg*zodie_$arg-horoscop_zilnic.html"
set http [http::config -useragent mozilla]
set http [http::geturl $pagina -timeout [expr 1000 * 10]]
set html [http::data $http]
http::cleanup $http ;
regexp {<div class="textArticol">(.*)} $html horoscopo
regsub -all "<div class=\"textArticol\">" $horoscopo "" horoscopo
regsub -all "</div>" $horoscopo "" horoscopo
putserv "PRIVMSG $nick :[string toupper $arg]: $horoscopo"
}
putlog "Horoscop loaded sucessfully. Created by Costin"
when i do !horoscop berbec for example all i get is BERBEC:
and nothing more. thanks
Last edited by while on Sun May 18, 2014 10:45 am, edited 1 time in total.
:)
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

Code: Select all

package require http

setudef flag horoscop

 bind pub -|- !horoscop check_zodie 

 proc check_zodie {nick uhost hand chan arg} { 
    if {![channel get $chan horoscop]} { return 0 } 

        set target [lindex [split [string tolower $arg]] 0]
    if {$target eq "" || ![regexp {^(berbec|taur|gemeni|rac|leu|fecioara|balanta|scorpion|sagetator|capricorn|varsator|pesti)$} $target]} { 
        putserv "NOTICE $nick :Foloseste: !horoscop <semn zodiacal>" 
        return 0 
        } 
		
        set pagina "http://www.zodii.ro/zodiac/$target*zodie_$target-horoscop_zilnic.html" 
        set http [http::config -useragent "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)"]
        set http [http::geturl $pagina -timeout [expr {1000*5}]] 
        set html [http::data $http] 
        http::cleanup $http
		
		  regsub -all -- "\n" $html "" html
        regexp {</iframe><br />(.*?)</div>} $html a horoscopo
        putserv "NOTICE $nick :[string toupper $target]: $horoscopo"
		return 0
 } 
 
 putlog "Horoscop loaded sucessfully. Created by Costin" 
!horoscop balanta
bot- BALANTA: Doresti sa faci cat mai multe dar exista riscul sa gresesti. Oboseala acumulata in ultimul timp te-ar putea face sa fii mai putin eficient. O persoana mai putin cunoscuta incearca sa traga niste sfori pentru a-ti face rau, dar se va gasi cineva care sa te protejeze. Orienteaza-te spre activitati de rutina mai ales in prima parte a zilei.
> !horoscop scorpion
bot- SCORPION: Cineva din anturajul de la serviciu ti-ar putea face unele reprosuri, dar nu este cazul sa te enervezi. Traversezi o perioada in care daca doresti sa ai succes trebuie sa fii atent la toate detaliile. Colegii te vor sprijini, dar va trebui sa faci destul de multe de unul singur.Din punct de vedere financiar nu se poate spune ca nu sunt sanse de succes, dar ceva mai multa prudenta nu are ce sa-ti strice.
> !horoscop leu
bot- LEU: Nu vei fi intr-o forma prea buna si ar fi de dorit sa nu te implici in activitati care sa te suprasolicite. Obosesti mai repede decat in mod obisnuit, asa ca excesul de activitati te va face mai putin eficient. Consumul excesiv de cafea si tutun nu va face decat sa-ti accentueze sarea oboseala. Vei avea ocazia sa petreci o dupa-amiaza placuta in compania prietenilor.
Life iS Just a dReaM oN tHE wAy to DeaTh
w
while
Voice
Posts: 34
Joined: Sat Jul 11, 2009 9:05 am
Location: beat mort

Post by while »

thank you very much.
:)
Post Reply