pony

horoTewl

Sep 3rd, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.47 KB | None | 0 0
  1. on *:text:!horoscope*:#: {
  2.   if ($group(#horoscope).status == on) { msg $chan Please wait a few moments. }
  3.   if ($group(#horoscope).status == off) {
  4.     if ($istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46)) {
  5.       set %horosign $lower($2) | set %horochan $chan
  6.       sockopen horoscope www.astrology.com 80
  7.       .enable #horoscope
  8.     }
  9.     if (!$2 || !$istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46)) {
  10.       msg $chan Horoscope usage: !Horoscope <sign>
  11.       msg $chan Options: Aquarius Pisces Aries Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius Capricorn
  12.     }
  13.   }
  14. }
  15. #horoscope off
  16. on *:sockopen:horoscope: {
  17.   sockwrite -nt $sockname GET $+(/horoscope/daily/,%horosign,.html) HTTP/1.1
  18.   sockwrite -nt $sockname Host: www.astrology.com
  19.   sockwrite -nt $sockname Connection: close
  20.   sockwrite -n $sockname $crlf
  21. }
  22. on *:sockread:horoscope: {
  23.   sockread %horotemp
  24.   if ("page-horoscope-text" isin %horotemp) {
  25.     var %horoscope $regex(horoscope,%horotemp,/(<div class="page-horoscope-text">)(.*)(</div>)/g)
  26.     if (%horoscope == 1) set %horooverview $regml(horoscope,2)
  27.   }
  28. }
  29. on *:sockclose:horoscope: {
  30.   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]
  31.   msg %horochan Daily: %horooverview
  32.   unset %horo*
  33.   .disable #horoscope
  34. }
  35. #horoscope end
Advertisement
Add Comment
Please, Sign In to add comment