###
# NowPlaying.tcl v0.1 by greenbear <at> gmail.com
#
# Announce current and upcomming movies at the theatres.
bind pub - !nowplaying pub:playing
bind pub - !commingsoon pub:comming
if ![info exists egghttp(version)] {
putlog "egghttp.tcl was NOT successfully loaded."
}
proc pub:playing {nick uhost hand chan text} {
set sock [egghttp:geturl http://www.movietome.com/ [list parse:mtome $chan 0]]
}
proc pub:comming {nick uhost hand chan text} {
set sock [egghttp:geturl http://www.movietome.com/ [list parse:mtome $chan 1]]
}
proc parse:mtome {chan type sock} {
set data [egghttp:data $sock]
egghttp:cleanup $sock
set data [string map {"\n" ""} $data]
set data [string map {"<p>" "<p>\n"} $data]
if {!$type} {
set to "Recently released movies:"
} {
set to "Upcoming movies:"
}
foreach line [split $data \n] {
if [string match -noc "*$to*" $line] {
set line [string map {"<br>" "<br>\n"} $line]
regsub -all {<(.|\n)*?>} $line {} line
foreach out [split $line \n] {
if ![string match -noc "*Terms of Service*" $out] {
putserv "PRIVMSG $chan :$out"
}
}
continue
}
}
}
putlog "NowPlaying.tcl loaded."
The website changed and now redirects to filmspot.com.. Would be easier to simply write a new script to work with the new site. I'll put it on my todo list and see if I can get one written in a day or 3.