on *:TEXT:*:#channel: {
if ( $1 == !tonight ) {
set %dayy 1
set %cchan msg #channel
tvrage2 d
}
if ( $1 == !tomorrow ) {
set %dayy 10
set %cchan msg #channel
tvrage2
}
}
on *:sockopen:tvrage2_*:{
sockwrite -n tvrage2_ $+ %tvrage.temp GET http://www.tvrage.com/quickschedule.php?country=US
}
on *:sockread:tvrage2_*:{
var %temptext
sockread %temptext
; echo -a %temptext
write test.log %temptext
if ([DAY] isin %temptext) {
if (%dayy == 1) {
; echo -a got day %day
set %day $remove(%temptext,[DAY],[/DAY]) GMT
%cchan $+ %day
set %dayy %dayy + 1
halt
}
set %dayy hiii
}
if ([TIME] isin %temptext) {
set %time $remove(%temptext,[TIME],[/TIME])
; echo -a got time %time
}
if ([SHOW] isin %temptext) {
if (%dayy == 2) {
; echo -a sup %dayy
set %show ( $+ $remove($gettok(%temptext,1,94),[SHOW]) $+ ) $replace($remove($gettok(%temptext,2-,94),[SHOW],[/SHOW]),^,$chr(32),http://, - http://)
%cchan %time - %show
halt
}
}
}
alias tvrage2 {
set %tvrage.temp $replace($1-,$chr(32),+)
sockopen tvrage2_ $+ %tvrage.temp www.tvrage.com 80
}
alias tonight
set %dayy 1
set %cchan msg #channel
tvrage2 d
}
alias tomorrow {
set %dayy 10
set %cchan msg #channel
tvrage2
}