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 

[SOLVED] horoscop tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
while
Voice


Joined: 11 Jul 2009
Posts: 34
Location: beat mort

PostPosted: Thu May 15, 2014 7:15 am    Post subject: [SOLVED] horoscop tcl Reply with quote

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
_________________
Smile


Last edited by while on Sun May 18, 2014 10:45 am; edited 1 time in total
Back to top
View user's profile Send private message
heartbroken
Op


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Thu May 15, 2014 12:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
while
Voice


Joined: 11 Jul 2009
Posts: 34
Location: beat mort

PostPosted: Sun May 18, 2014 10:44 am    Post subject: Reply with quote

thank you very much.
_________________
Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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