| View previous topic :: View next topic |
| Author |
Message |
while Voice
Joined: 11 Jul 2009 Posts: 34 Location: beat mort
|
Posted: Thu May 15, 2014 7:15 am Post subject: [SOLVED] horoscop tcl |
|
|
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: |
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 |
|
| Back to top |
|
 |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Thu May 15, 2014 12:18 pm Post subject: |
|
|
| Code: | 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" |
| Quote: | !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 |
|
| Back to top |
|
 |
while Voice
Joined: 11 Jul 2009 Posts: 34 Location: beat mort
|
Posted: Sun May 18, 2014 10:44 am Post subject: |
|
|
thank you very much. _________________
 |
|
| Back to top |
|
 |
|