This is my first socket script, it retrieves daily overviews of horoscopes from astrology.yahoo.com !
Edit the "#ChannelNameHere" to your channel and once you've done that, Paste the snippet on your bot's Remotes (Alt + R). Once loaded, Get into the channel you set, and type !horoscope HoroscopeHere
Current commands are, !horoscope HoroscopeHere which retrieves your horoscope
!horoscope about , which returns the maker of this script
!horoscope help , which gives help on how to use the script
Enjoy :)
alias horoz {
sockopen horo astrology.yahoo.com 80
}
on 1:sockopen:horo:{
sockwrite -n horo GET %horoz HTTP/1.0
sockwrite -n horo Host: astrology.yahoo.com
sockwrite -n horo Connection: Keep-Alive
sockwrite -n horo $crlf
}
on 1:sockread:horo:{
if ($sockerr) { msg #ChannelNameHere Socket Error: $sockerr }
else {
sockread %temp
if (<b class="yastshdotxt">Overview:</b><br> isin %temp) { msg #ChannelNameHere Overview: $remove(%temp,</b>,<br>,<b class="yastshdotxt">,Overview:) | sockclose horo }
}
}
on 1:TEXT:!horoscope*:#ChannelNameHere:{
if ($2 == Gemini) { set %horoz /astrology/general/dailyoverview/gemini | horoz }
if ($2 == Aries) { set %horoz /astrology/general/dailyoverview/aries | horoz }
if ($2 == Taurus) { set %horoz /astrology/general/dailyoverview/taurus | horoz }
if ($2 == Cancer) { set %horoz /astrology/general/dailyoverview/cancer | horoz }
if ($2 == Leo) { set %horoz /astrology/general/dailyoverview/leo | horoz }
if ($2 == Virgo) { set %horoz /astrology/general/dailyoverview/virgo | horoz }
if ($2 == Libra) { set %horoz /astrology/general/dailyoverview/libra | horoz }
if ($2 == Scorpio) { set %horoz /astrology/general/dailyoverview/scorpio | horoz }
if ($2 == Sagittarius) { set %horoz /astrology/general/dailyoverview/sagittarius | horoz }
if ($2 == Capricorn) { set %horoz /astrology/general/dailyoverview/capricorn | horoz }
if ($2 == Pisces) { set %horoz /astrology/general/dailyoverview/pisces | horoz }
if ($2 == Aquarius) { set %horoz /astrology/general/dailyoverview/aquarius | horoz }
if ($2 == about) { msg #ChannelNameHere 4::14[ XHoroscope Made By Xtreme 14]:4: }
if ($2 == help) { msg #ChannelNameHere Availabe Commands: !horoscope HoroscopeHere (Retrieves your horoscope) , !horoscope help (What you're reading now) , !horoscope about (The maker of this script) }
}