Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #horo on
- on *:text:!horoscope*:#: {
- if ($group(#horoscope).status == off) { msg $chan Please wait a few moments. }
- if ($group(#horoscope).status == on) {
- if ($istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46)) {
- set %horosign $lower($2) | set %horochan $chan
- sockopen -e horoscope www.astrology.com 443
- .enable #horoscope
- }
- if (!$2 || !$istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46)) {
- msg $chan Horoscope usage: !Horoscope <sign>
- msg $chan Options: Aquarius Pisces Aries Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius Capricorn
- }
- }
- }
- #horoscope on
- on *:sockopen:horoscope: {
- sockwrite -nt $sockname GET $+(/horoscope/daily/,%horosign,.html) HTTP/1.1
- sockwrite -nt $sockname Host: www.astrology.com
- sockwrite -nt $sockname Connection: close
- sockwrite -n $sockname $crlf
- }
- on *:sockread:horoscope: {
- sockread %horotemp
- if (%horotemp) .echo -a >> $v1
- if ("page-horoscope-text" isin %horotemp) {
- var %horoscope $regex(horoscope,%horotemp,/(<div class="page-horoscope-text">)(.*)(</div>)/g)
- if (%horoscope == 1) set %horooverview $regml(horoscope,2)
- }
- }
- on *:sockclose:horoscope: {
- msg %horochan [Style ff:Comic Sans MS;co:#FF0000;b;]Horoscope for $upper($left(%horosign,1)) $+ $right(%horosign,-1) for $asctime(mmm dd yyyy) [/style]
- msg %horochan Daily: %horooverview
- msg %horochan [Style ff:Comic Sans MS;co:#FF0000;b;] Credits To Tewl / Pony [/style]
- unset %horo*
- .disable #horoscope
- }
- #horoscope end
- #horo end
Advertisement
Add Comment
Please, Sign In to add comment