SRU

TVRage

SRU
Mar 10th, 2013
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 39.86 KB | None | 0 0
  1. ;*** TVRage - "Original" code by Gecko321 (www.mirc.net/projects.php?go=1204694830) *** SRU EDiT - Downloaded from: http://www.hawkee.com/snippet/9506/
  2. on *:LOAD:dialog -m TVSettings TVSettings -4
  3. on *:UNLOAD:.unset %TV_*
  4. menu Channel,Status,Menubar,Query {
  5.   -
  6.   $iif(%TV_Rage = 1,$style(1)) TVRage $+($chr(40),$iif(%TV_Rage = 1,Enabled,Disabled),$chr(41))
  7.   .Settings:dialog -m TVSettings TVSettings -4
  8.   .Self Search:dialog -m SelfSearch SelfSearch -4
  9.   .-
  10.   .Turn $iif(%TV_Rage != 1,on,off) :$iif(%TV_Rage != 1,%TV_Rage = 1,%TV_Rage = 0) | $iif(!%TV_Where,%TV_Where = 1) | $iif(!%TV_Where2,%TV_Where2 = 0) | $iif(!%TV_Color,%TV_Color = 1) | echo -at 14TVRage Has been $iif(%TV_Rage = 1,9enabled,4disabled)
  11.   -
  12. }
  13. on @*:TEXT:*:#: { if ($left($strip($1),1) == !) || ($left($strip($1),1) == .) || ($left($strip($1),1) == @) && (($mid($strip($1),2,4) == SHOW && $len($strip($1)) == 5) || ($mid($strip($1),2,5) == TODAY && $len($strip($1)) == 6) || ($mid($strip($1),2,8) == TOMORROW && $len($strip($1)) == 9) || ($mid($strip($1),2,2) == TV && $len($strip($1)) == 3) || ($mid($strip($1),2,2) == EP && $len($strip($1)) == 3) || ($mid($strip($1),2,1) == N && $len($strip($1)) == 2) || ($mid($strip($1),2,4) == Next && $len($strip($1)) == 5) || ($mid($strip($1),2,1) == L && $len($strip($1)) == 2) || ($mid($strip($1),2,4) == Last && $len($strip($1)) == 5)) && (!$timer($+(SPAM,$network,$nick))) { .timer $+ $+(SPAM,$network,$nick) 1 3 noop | mTVRage $strip($1-) } }
  14. on @*:INPUT:#: {
  15.   if ($left($strip($1),1) == !) || ($left($strip($1),1) == .) || ($left($strip($1),1) == @) && (($mid($strip($1),2,4) == SHOW && $len($strip($1)) == 5) || ($mid($strip($1),2,5) == TODAY && $len($strip($1)) == 6) || ($mid($strip($1),2,8) == TOMORROW && $len($strip($1)) == 9) || ($mid($strip($1),2,2) == TV && $len($strip($1)) == 3) || ($mid($strip($1),2,2) == EP && $len($strip($1)) == 3) || ($mid($strip($1),2,1) == N && $len($strip($1)) == 2) || ($mid($strip($1),2,1) == L && $len($strip($1)) == 2)) && (%TV_Rage == 1) { var %num = $trnum
  16.     if ($2 = Schedule) { set %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where2 = 1,$me,$Target) }
  17.     elseif ($Target !ischan) { set %TVRage_Target. [ $+ [ %num ] ] $me | set %TVRage_Query. [ $+ [ %num ] ] 1 }
  18.     else { set %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where = 1,$Target,$me) }
  19.     set %TVRage_Chan. [ $+ [ %num ] ] $chan | set %TVRage_Nick. [ $+ [ %num ] ] $me
  20.     TVRage.Load %num $1-
  21.   }
  22. }
  23. alias mTVRage {
  24.   ;*** Not turned on
  25.   if (%TV_Rage == 0) { halt }
  26.   ;************************************************************
  27.   var %num = $trnum | set -u17 %TVRage_TargetC. [ $+ [ %num ] ] # | set %TVRage_Nick. [ $+ [ %num ] ] $nick | set %TVRage_Chan. [ $+ [ %num ] ] $chan
  28.   ;************************************************************************************************************************************
  29.   if ($Target !ischan) || ($2 == Schedule) || ($mid($strip($1),2,5) == TODAY) || ($mid($strip($1),2,8) == TOMORROW) || (Trigger isin $1-2) { set %TVRage_Target. [ $+ [ %num ] ] $nick | set %TVRage_Query. [ $+ [ %num ] ] 1 }
  30.   else { set -u17 %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where = 1,$chan,$nick) }
  31.   ;************************************************************************************************************************************
  32.   ;*** !TV TRiGGER / CMDS / HELP / COMMANDs
  33.   if (($2 = TRIGGERs) || ($2 == CMDS) || ($2 == HELP) || ($2 == COMMANDs)) && (!$3) { var %X $r(1,2), %O $left($strip($1),1) | var %Y $iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | var %Z $iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | var %C $iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,%O,SHOW) 4<3Show4> 5EX: $+(%O,SHOW) %Y 15ooO( Get show description 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif(%X == 1,$+(%O,NEXT) 15/ $+(3,%O,LAST),$+(,%O,N) 15/ $+(3,%O,L)) 4<3Show4>) 5EX: $iif(%X == 1,$+(%O,NEXT) %Z 15/ $+(%O,LAST),$+(%O,N) %Z 15/ $+(%O,L)) %Z 15ooO( Get information for next 15/ last episode 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif($1 == $+(%O,EP),$v2,$+(%O,TV))) 4<3Show4> (3Season and Episode4) 5EX: $iif($1 == $+(%O,EP),$v2,$+(%O,TV)) %C $+($r(1,3),x0,$r(1,5)) 15ooO( Get general show information and episode summary (if season and episode is given) 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif($1 == !EP,$v2,!TV)) Schedule 4<3Day of Week4> (3Time4) (3Country4) 5EX: $iif($1 == !EP,$v2,!TV) Schedule Fri 10 $iif(%X == 1,GB,$iif(%X == 1,UK,AU)) 5Country: 3GB14, 3UK 14and 3AU (4US by default) 15ooO( Get program schedule for the requested day (Time and/or Country) 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- 4NOTE: Options in 4( ) are optional... and options in 4< > are required. | .unset %Y %Z %C %TVRage* [ $+ [ %num ] ] | halt }
  34.   ;************************************************************************************************************************************
  35.   ;*** !N / !NEXT
  36.   elseif ($1 == !N) || ($1 == !NEXT) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] NEXT }
  37.   ;*** !L / !LAST
  38.   elseif ($1 == !L) || ($1 == !LAST) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] LAST }
  39.   ;*** !SHOW / !SUMMARY
  40.   elseif ($1 == !SHOW) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] SHOW }
  41.   ;*** !TODAY / !TOMORROW
  42.   elseif ($1 == !TODAY) || ($1 == !TOMORROW) { set %TVRage_Schedule. [ $+ [ %num ] ] !TV Schedule $remove($1-,!) }
  43.   ;************************************************************************************************************************************
  44.   TVRage.Load %num $iif(%TVRage_Schedule. [ $+ [ %num ] ],$v1,$replace($1-,BMS,Blue Mountain State,HiMYM,How I Met Your Mother,TUT,The Ultimate Fighter,DH,Desperate Housewives,A23,Don't Trust the B---- in Apartment 23))
  45. }
  46. alias -l TVRage.Load { var %num = $1
  47.   if ($3 == Schedule) { set %TVRage_Type. [ $+ [ %num ] ] $v1
  48.     var %temp $GetTok($2-,$numtok($2-,32),32)
  49.     if ((%Temp = GB) || (%Temp = UK) || (%Temp = US) || (%Temp = AU)) { set %TVRage_Country. [ $+ [ %num ] ] $v1 | set %TVRage_Type. [ $+ [ %num ] ] Country }
  50.     set %TVRage_Time_Schedule. [ $+ [ %num ] ] $iif($5 !isnum,$null,$Int($5)) | set %TVRage_Date. [ $+ [ %num ] ] $FullDate($4)
  51.     if (%TVRage_Date. [ $+ [ %num ] ] = $null) { msg %TVRage_Target. [ $+ [ %num ] ] You need to pick a 4Day of the Week $iif(!%TVRage_Country. [ $+ [ %num ] ],or 4Country) | unset %TVRage_*. [ $+ [ %num ] ] %Check_*. [ $+ [ %num ] ] }
  52.     TVRage %Num Schedule
  53.   }
  54.   else { $iif($CheckEP(%num,$3-) = 1,set %TVRage_Type. [ $+ [ %num ] ] EPSpec,$iif($2 == !SHOW,set %TVRage_Type. [ $+ [ %num ] ] SHOW,set %TVRage_Type. [ $+ [ %num ] ] Ep)) | TVRage %num $3- }
  55. }
  56. alias -l TVRage {
  57.   if ((%TVRage_Type. [ $+ [ $1 ] ] != Schedule) && (!$2)) { msg %TVRage_Target. [ $+ [ $1 ] ] Hmmm... you actually need to search for a TV-Show you know! 5Type: !TV Triggers 5for more help | .unset %TVRage_*. [ $+ [ $1 ] ] | return }
  58.   elseif (%TVRage_Type. [ $+ [ $1 ] ] = EPSpec) { %tvshow. [ $+ [ $1 ] ] = $+($replace($GetTok($2-,1- [ $Calc($numtok($2-,32)-1) ] ,32),$chr(32),% $+ 20),&ep=,%Check_Season. [ $+ [ $1 ] ],x,%Check_EP. [ $+ [ $1 ] ]) }
  59.   else { %TVShow. [ $+ [ $1 ] ] = $replace($2-,$chr(32),% $+ 20) }
  60.   sockopen TVRage. [ $+ [ $1 ] ] services.tvrage.com 80
  61. }
  62. ;*** BetterDuration (renamed LongTime+ here) *** Downloaded from: http://www.nealirc.org/IRC/mIRC.html
  63. alias LongTime+ { var %lifeseconds = $abs($1) | var %age, %years, %days, %hours, %minutes, %seconds, %temp | %years = $int($calc(%lifeseconds / 31557600)) | if (%years != 0) { %age = $+(15,%years,14year,$iif(%years > 1,s)) } | %temp = $calc(%lifeseconds - (%years * 31557600)) | %days = $int($calc(%temp / 86400)) | if (%days != 0) { %age = %age $+(15,%days,14day,$iif(%days > 1,s)) } | %temp = $calc(%temp - (%days * 86400)) | %hours = $int($calc(%temp / 3600)) | if (%hours != 0) { %age = %age $+(15,%hours,14hour,$iif(%hours > 1,s)) } | %temp = $calc(%temp - (%hours * 3600)) | %minutes = $int($calc(%temp / 60)) | if (%minutes != 0) { %age = %age $+(15,%minutes,14minute,$iif(%minutes > 1,s)) } | %seconds = $calc(%temp % 60) | if (%seconds != 0) { %age = %age $+(15,%seconds,14second,$iif(%seconds > 1,s)) } | return $iif($right(%age, 1) == $chr(44),$left(%age, -1),%age) }
  64. ;*****************************************************************************************************************************************************************************************************************************************************************
  65. alias replaceLiNK { return $replace($remove($1, ),�?�©,�©,&aring;,�¥,&#39;,',&quot;,",&amp,&,&#x27;,',&#39;,',&ndash;,â??,&middot;,�·,&raquo;,�»,&laquo;,�«,&Uuml;,�?,&uuml;,�¼,&Aacute;,�,&aacute;,�¡,&Eacute;,�?,&eacute;,�©,&Iacute;,�,&iacute;,�­,&Oacute;,�?,&oacute;,�³,&Ntilde;,�?,&ntilde;,�±,&Uacute;,�?,&uacute;,�º,&nbsp;,$chr(32),&#8221;,â?,&#8220;,â??,#8220;,â??,#8221;,â?,&#230;,�¦,&#229;,�¥,&#197;,�?,&#248;,�¸,&#216;,�?,�¢â?¬â?+a,$+($chr(32),â??,$chr(32)),�¢â?¬â?,$chr(32),�?�¡,�¡,�?�®,�®,�¢â??�¢,â?¢,�?�©,�©,&#xE5;,�¥,&#8230;,â?¦,&mdash;,-,&#039;,',&#8216;,â??,�?â?°,�?,&#34;,",&#8217;,',&#8211;,-,�?�©,�©,&aelig;,�¦,&quot;,",�?�¦,�¦, �?�¸ ,�¸,�?�¥,�¥,�?â? ,�?,�?�?,�?,�?,�?,&#39;,',�¢â?¬â?¢,',188.114.142.12,HiDDEN,&apos;,',#8217;,â??,&micro;,�³,#8211;,-,&oslash;,�¸,&#8212;,a,�¢â?¬�?,â??,�?�¤,�¤,-&#160;,-,&#8242;,',�?�¼,�¼,�?�©,�©,�?�©,�©,�?�¶,�¶,&#252;,�¼,&#198;,�?,�?â?¦,�?,&#233;,�©,\u0027,',�¢â?¬�?,â??,�¢â?¬,â?,&#38;,&,|,|) }
  66. alias -l trnum { var %trnum $base($calc($base(%trnum,36,10) +1),10,36) | return %trnum }
  67. alias -l noHTML { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,&nbsp;) | return %x }
  68. alias -l LongTime { return $+(15,$replacex($1,wks,14weeks15,wk,14week15,days,14days15,day,14day15,hrs,14hours15,hr,14hour15,mins,14minutes15,min,14minute15,sec,14second),14) }
  69. alias -l FullDate { return $iif($Mid($1,1,3) == Tom,$replacex($day,Sun,Mon,Mon,Tues,Tues,Wednes,Wednes,Thurs,Thurs,Fri,Fri,Satur,Satur,Sun),$iif($Mid($1,1,3) == Yes,$replace($day,Mon,Sun,Tues,Mon,Wednes,Tues,Thurs,Wednes,Fri,Thurs,Satur,Fri,Sun,Satur),$iif($Mid($1,1,3) == Tod,$day,$iif($Mid($1,1,3) == Mon,Monday,$iif($Mid($1,1,3) == Tue,Tuesday,$iif($Mid($1,1,3) == Wed,Wednesday,$iif($Mid($1,1,3) == Thu,Thursday,$iif($Mid($1,1,3) == Fri,Friday,$iif($Mid($1,1,3) == Sat,Saturday,$iif($Mid($1,1,3) == Sun,Sunday,$null)))))))))) }
  70. alias -l SetMonth { return $replace($1,Jan,1,Feb,2,Mar,3,Apr,4,May,5,Jun,6,Jul,7,Aug,8,Sep,9,Oct,10,Nov,11,Dec,12) }
  71. ;*** Text Overflow Limiting *** Downloaded from: http://www.hawkee.com/snippet/7305/
  72. alias mCuttext { var %ch $1,%str $2-,%max $calc(498 - $len(%ch) - $len($address($me,5)))
  73.   while (%str) { var %cut $limtok(%str,%max,32) | msg %ch %cut | var %str $gettok(%str,$+($calc($numtok(%cut,32) + 1),-),32) }
  74. }
  75. alias mCuttextN { var %ch $1,%str $2-,%max $calc(498 - $len(%ch) - $len($address($me,5)))
  76.   while (%str) { var %cut $limtok(%str,%max,32) | .notice %ch %cut | var %str $gettok(%str,$+($calc($numtok(%cut,32) + 1),-),32) }
  77. }
  78. alias limtok { if ($len($gettok($1,1,$3)) >= $2) { return $left($1,$2) } | var %x 1,%str,%c | while ($gettok($1,%x,$$3)) { var %c $v1 | if ($calc($len(%c) + $len(%str)) <= $2) { var %str $+(%str,$chr($3),%c) } | else { break } | inc %x } | return $mid(%str,2) }
  79. ;*****************************************************************************************************************************************************************************************************************************************************************
  80. alias -l Check.Settings {
  81.   if ($1 = Ep) || ($1 = Sch) {
  82.     if (%TV_Where == $null) || (%TV_Where2 == $null) { $iif($1 = Sch,set -u17 %TV_Where,set -u17 %TV_Where2) 0 }
  83.     if (%TV_Where == 1) || (%TV_Where2 == 1) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Chan. [ $+ [ $2 ] ] }
  84.     elseif (%TV_Where == 0) || (%TV_Where2 == 0) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Nick. [ $+ [ $2 ] ] }
  85.     if (%TVRage_Query. [ $+ [ $2 ] ] == 1) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Nick. [ $+ [ $2 ] ] }
  86.   }
  87. }
  88. alias -l CheckEP {
  89.   var %temp $GetTok($2-,$numtok($2-,32),32)
  90.   $iif(e isin %Temp,%Temp = $replace(%Temp,e,x))
  91.   set %Check_Season. [ $+ [ $1 ] ] $Mid(%Temp,1,$Calc($pos(%Temp,x)-1))
  92.   set %Check_EP. [ $+ [ $1 ] ] $Mid(%Temp,$Calc($pos(%Temp,x)+1))
  93.   if ($mid(%Check_Season. [ $+ [ $1 ] ],1,1) = s) { Set %Check_Season. [ $+ [ $1 ] ] $Mid(%Check_Season. [ $+ [ $1 ] ],2) }
  94.   if ((%Check_season. [ $+ [ $1 ] ] isnum) && (%Check_EP. [ $+ [ $1 ] ] isnum)) { Return 1 }
  95.   else { Return 0 }
  96. }
  97. alias -l msg {
  98.   if (%TV_Color = 0) { var %Temp = $strip($1-) | tokenize 32 %Temp }
  99.   if ($Show) { $iif($1 !ischan,!.msg $1 $iif(%TV_Color == 0,$strip($2-),$2-),!msg $1 $iif(c isincs $chan($1).mode,$strip($2-),$iif(%TV_Color == 0,$strip($2-),$2-))) }
  100.   else { !.msg $1 $iif(c isincs $chan($1).mode,$strip($2-),$iif(%TV_Color == 0,$strip($2-),$2-)) }
  101. }
  102. on *:sockopen:TVRage.*: { var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  103.   if ($sockerr > 0) return
  104.   ;**************************
  105.   elseif (%TVRage_Type. [ $+ [ %num ] ] == Schedule) || (%TVRage_Type. [ $+ [ %num ] ] == Country) { msg %TVRage_TargetC. [ $+ [ %num ] ] 5PM14'5iNG $+(13,%TVRage_Target. [ $+ [ %num ] ],) the program schedule for $+(3,%TVRage_Date. [ $+ [ %num ] ],) $+(15,$chr(40),7,$iif(%TVRage_Country. [ $+ [ %num ] ],$v1,US),$iif(%TVRage_Time_Schedule. [ $+ [ %num ] ],$+($chr(32),14-4#14-) $+(15,$v1) 14PM),15,$chr(41),) | sockwrite -n $SockName GET $+(/tools/quickschedule.php,$iif(%TVRage_Type. [ $+ [ %num ] ] == Country,$+(?country=,%TVRage_Country. [ $+ [ %num ] ]))) HTTP/1.1 }
  106.   ;*******************************************************************************************************
  107.   elseif (%TVRage_ONLY. [ $+ [ %num ] ] == SHOW) && (%show_ID. [ $+ [ %num ] ] != $null) { if (!%show_ID. [ $+ [ %num ] ]) { echo -at Sorry... unknown error... this option might not be implemented anymore | halt } | set %show_ID+. [ $+ [ %num ] ] %show_ID. [ $+ [ %num ] ] | sockwrite -n $sockname GET $+(/myfeeds/showinfo.php?key=sqsTSaJG4qJagM6ldpKZ&sid=,%show_ID+. [ $+ [ %num ] ]) HTTP/1.1 }
  108.   ;****************************************************************************************
  109.   elseif ((%TVRage_Type. [ $+ [ %num ] ] == SHOW) || (%TVRage_Type. [ $+ [ %num ] ] = EP) || (%TVRage_Type. [ $+ [ %num ] ] = EPSpec)) { sockwrite -n $sockname GET $+(/tools/quickinfo.php?show=,%tvshow. [ $+ [ %num ] ]) HTTP/1.0 }
  110.   ;************************************
  111.   set %TVRage_Day. [ $+ [ %num ] ] 0
  112.   ;************************************
  113.   sockwrite -n $sockname Host: $iif(%HOST,$v1,services.tvrage.com)
  114.   sockwrite -n $sockname Connection: keep-alive
  115.   sockwrite $sockname $crlf
  116. }
  117. on *:sockread:TVRage.*: { var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  118.   if ($sockerr) { return }
  119.   var %TVRead | sockread %TVRead
  120.   ;************************************************************************************************************************************
  121.   if (*Accept-Ranges:* iswm %TVRead) || (*X-Src-Webcache:* iswm %TVRead) || (*Connection:* iswm %TVRead) || (*TCN:* iswm %TVRead) || (*Content-Type:* iswm %TVRead) || (*Keep-Alive:* iswm %TVRead) || (*Date:* iswm %TVRead) || (*Server:* iswm %TVRead) || (*X-Powered-By:* iswm %TVRead) || (*Vary:* iswm %TVRead) || (*Content-Length:* iswm %TVRead) || (*Expires:* iswm %TVRead) || (*Cache-Control:* iswm %TVRead) || (*Pragma:* iswm %TVRead) || (*Set-Cookie:* iswm %TVRead) || (*Transfer-Encoding:* iswm %TVRead) || (*HTTP/1.1 200 OK* iswm %TVRead) || (*HTTP/1.1 501 Invalid Request* iswm %TVRead) || (*HTTP/1.1 404* iswm %TVRead) { $iif(*HTTP/1.1 404* iswm %TVRead,$iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) $remove(%TVRead,HTTP/1.1 404),$iif(*HTTP/1.1 501 Invalid Request* iswm %TVRead,$iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) Sorry... bad request... try again)) | $iif(*HTTP/1.1 404* iswm %TVRead,sockclose $sockname,$iif(*HTTP/1.1 501 Invalid Request* iswm %TVRead,sockclose $sockname)) | return }
  122.   ;*** Testing
  123.   ;  $iif(%TVRead != $null,echo -at $+(5,$replace($remove($v1,<pre>),@,15@14)))
  124.   ;***********************************************************************************
  125.   ;*** Show summary
  126.   if (%show_ID+. [ $+ [ %num ] ]) {
  127.     if (<image> isin %TVRead) { set %show_PiC [ $+ [ %num ] ] $nohtml(%TVRead) }
  128.     elseif (<summary> isin %TVRead) { %X = $replaceLiNK($remove(%TVRead,<summary>,  )) | $iif(*</summary>* iswm %TVRead,set %X $mid(%X,1,$calc($pos(%X,</summary>) -1))) | write tvrage.txt %X | unset %X }
  129.     elseif ($regex(%TVRead,<[^<>]+>) == 0) { $iif(%TVRead != $null,write tvrage.txt $replaceLiNK($v1)) }
  130.     if (</summary> isin %TVRead) { sockclose $sockname | $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [ $+(05,%show_name. [ $+ [ %num ] ]) ] $iif(%show_Ended. [ $+ [ %num ] ] != $null,$+(,%show_Status. [ $+ [ %num ] ],) 14-4#14- $LongTime+($calc($cTime -$cTime($SetMonth(%show_Ended. [ $+ [ %num ] ])))) ago $+($chr(40),15,$replace(%show_Ended. [ $+ [ %num ] ],/,14/15),,$chr(41)),$iif(%show_Airtime. [ $+ [ %num ] ],$+(4,$v1,))) $iif(%show_Class. [ $+ [ %num ] ],$+(,$chr(40),15,$v1,,$chr(41),)) $iif(%show_Genre. [ $+ [ %num ] ],$+(14,$replace($v1,|,15/14),)) $iif(!%show_Ended. [ $+ [ %num ] ],since,from) $+(7,%show_Started. [ $+ [ %num ] ],$iif($len(%show_Ended. [ $+ [ %num ] ]) == 11 && %show_Started. [ $+ [ %num ] ] !isin %show_Ended. [ $+ [ %num ] ],$+(14-07,$gettok($v2,3,47))),) $iif(!%show_Ended. [ $+ [ %num ] ],$+(,$chr(40),%show_Status. [ $+ [ %num ] ],,$chr(41),)) $iif(%show_Network. [ $+ [ %num ] ] != $null,$iif(!%show_Ended. [ $+ [ %num ] ],airs,aired) on $+(7,$iif(%show_Country. [ $+ [ %num ] ] !isin %show_Network. [ $+ [ %num ] ],$v2 $+(15,$chr(40),07,$v1,15,$chr(41)),$replace($v2,$chr(40),$+(15,$chr(40),07),$chr(41),$+(15,$chr(41)))),)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),))) $iif(%show_PiC [ $+ [ %num ] ],5Show images: $+(2,$v1,))
  131.     if ($lines(tvrage.txt) >= 1) { var %x 1 | while (%x <= $lines(tvrage.txt)) { $iif(%TVRage_Target. [ $+ [ %num ] ],$iif($lines(tvrage.txt) <= 1,mCuttext %TVRage_Target. [ $+ [ %num ] ],mCuttextN %TVRage_Nick. [ $+ [ %num ] ]),echo -at) $iif(%x == 1,5Description:) $read(tvrage.txt,%x) | inc %x } | .remove tvrage.txt } | goto ENDiTNOW }
  132.     return
  133.   }
  134.   ;************************************************************************************************************************************
  135.   ;*** Schedule
  136.   elseif (%TVRage_Type. [ $+ [ %num ] ] = Schedule) || (%TVRage_Type. [ $+ [ %num ] ] = Country) {
  137.     ;*** DAY
  138.     if ($mid(%TVRead,1,5) = [DAY]) { if ($Fopen(%TVRage_Day. [ $+ [ %num ] ])) { .fclose %TVRage_Day. [ $+ [ %num ] ] } | set -u17 %TVRage_Day. [ $+ [ %num ] ] $GetTok($Mid(%TVRead,6,$calc($pos(%TVRead,[/,1) - 6)),1,44) | if (%TVRage_Day. [ $+ [ %num ] ] = %TVRage_Date. [ $+ [ %num ] ]) { .fopen -no %TVRage_Day. [ $+ [ %num ] ] [ %TVRage_Day. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt | .fwrite -n %TVRage_Day. [ $+ [ %num ] ] $Mid(%TVRead,6,$calc($pos(%TVRead,[/,1) - 6)) } }
  139.     ;*** TiME
  140.     if ($regex(%TVRead,/\[TIME\](.*)\[\/TIME\]/i)) { set -u7 %sTiME $ascTime($cTime($date $regml(1)),HH:nn) }
  141.     ;*** SHOW
  142.     if ($regex(%TVRead,/\[SHOW\](.*)\[\/SHOW\]/i)) && (%TVRage_Day. [ $+ [ %num ] ] = %TVRage_Date. [ $+ [ %num ] ]) { set -u2 %TVRead_NetW $strip($remove($mid(%TVRead,$pos(%TVRead,]),$calc($pos(%TVRead,^,1) -$pos(%TVRead,],1))),])) | set -u2 %TVRead_TiTLE $strip($remove($mid(%TVRead,$pos(%TVRead,^,1),$calc($pos(%TVRead,^,2) -$pos(%TVRead,^,1))),^)) | set -u2 %TVRead_EP $strip($remove($mid(%TVRead,$pos(%TVRead,^,2),$calc($pos(%TVRead,^,3) -$pos(%TVRead,^,2))),^)) | set -u2 %TVRead_LiNK $strip($remove($mid(%TVRead,$pos(%TVRead,^,3),$calc($pos(%TVRead,[,2) -$pos(%TVRead,^,3))),^)) | set -u2 %TVRead_SHOW $+(4,[14,%sTiME,4]) $+(15,%TVRead_TiTLE,) 14-4#14- $+(14,$replace(%TVRead_EP,x,15x14),) 14-4#14- $+(8,%TVRead_NetW,) $+(,$chr(40),2,%TVRead_LiNK,,$chr(41),) | .fwrite -n %TVRage_Day. [ $+ [ %num ] ] %TVRead_SHOW }
  143.     return
  144.   }
  145.   if (!$sockbr) return
  146.   ;************************************************************************************************************************************
  147.   ;*** !TV / !EP / !SHOW / !NEXT / !N / !LAST / !L
  148.   elseif ($regex($strip(%TVRead),/Show ID@(.*)/)) { set %show_ID. [ $+ [ %num ] ] $regml(1) }
  149.   elseif ($regex($strip(%TVRead),/Show Name@(.*)/)) { set %show_Name. [ $+ [ %num ] ] $regml(1) }
  150.   elseif ($regex($strip(%TVRead),/Show URL@(.*)/)) { set %show_Link. [ $+ [ %num ] ] $remove($regml(1),http://) }
  151.   elseif ($regex($strip(%TVRead),/Premiered@(.*)/)) { set %show_Started. [ $+ [ %num ] ] $regml(1) }
  152.   elseif ($regex($strip(%TVRead),/Started@(.*)/)) { set %show_Started+. [ $+ [ %num ] ] $regml(1) }
  153.   elseif ($regex($strip(%TVRead),/Ended@(.*)/)) { set %show_Ended. [ $+ [ %num ] ] $regml(1) }
  154.   ;  elseif ($regex($strip(%TVRead),/Episode Info@(.*)/)) { set %show_EP. [ $+ [ %num ] ] $regml(1) }
  155.   elseif ($regex($strip(%TVRead),/Episode URL@(.*)/)) { set %show_URL. [ $+ [ %num ] ] $remove($regml(1),http://) }
  156.   ;  elseif ($regex($strip(%TVRead),/Latest Episode@(.*)/)) { set %show_Last. [ $+ [ %num ] ] $regml(1) }
  157.   ;  elseif ($regex($strip(%TVRead),/Next Episode@(.*)/)) { set %show_Next. [ $+ [ %num ] ] $regml(1) }
  158.   elseif ($regex($strip(%TVRead),/RFC3339@(.*)/)) { set %show_RFC. [ $+ [ %num ] ] $regml(1) }
  159.   elseif ($regex($strip(%TVRead),/GMT+0 NODST@(.*)/)) { set %show_GMT. [ $+ [ %num ] ] $regml(1) }
  160.   ;* ^ set %tvr.airnextepcmt $calc($gettok($regml(1),2,64) - $ctime + 3600) | echo -at %tvr.airnextepcmt vs $calc($gettok(%show_GMT. [ $+ [ %num ] ],2,64) - $ctime + 3600)
  161.   elseif ($regex($strip(%TVRead),/Country@(.*)/)) { set %show_Country. [ $+ [ %num ] ] $regml(1) }
  162.   elseif ($regex($strip(%TVRead),/Status@(.*)/)) { set %show_Status. [ $+ [ %num ] ] $replace($regml(1),Return,9Return,Final,3Final,Canceled/Ended,4Canceled,New,8New) }
  163.   elseif ($regex($strip(%TVRead),/Classification@(.*)/)) { set %show_Class. [ $+ [ %num ] ] $regml(1) }
  164.   elseif ($regex($strip(%TVRead),/Genres@(.*)/)) { set %show_Genre. [ $+ [ %num ] ] $regml(1) }
  165.   elseif ($regex($strip(%TVRead),/Network@(.*)/)) { set %show_Network. [ $+ [ %num ] ] $regml(1) }
  166.   ;  elseif ($regex($strip(%TVRead),/Airtime@(.*)/)) { set %show_Airtime. [ $+ [ %num ] ] $replace($regml(1),day,days,pm,PM,am,AM) }
  167.   ;  elseif ($regex($strip(%TVRead),/Runtime@(.*)/)) { set %show_Runtime. [ $+ [ %num ] ] $regml(1) }
  168.   ;************************************************************************************************************************************
  169.   ;*** Episode iNFO
  170.   elseif ($regex($strip(%TVRead),/Episode Info@(.*)/)) { set %show_EP. [ $+ [ %num ] ] $regml(1) | set -u3 %TVRead+ $gettok(%TVRead,2,64) | set -u3 %TVRead_DATE $gettok(%TVRead+,3,94) | set %TVRead_EP $gettok(%TVRead+,1,94) | set %TVRead_TiTLE $gettok(%TVRead+,2,94) | set %show_Spec. [ $+ [ %num ] ] $+(14,$replace(%TVRead_EP,x,15x14)) $iif(%TVRead_TiTLE,14-4#14- $+(15,$v1)) | set %show_Spec_Title. [ $+ [ %num ] ] %TVRead_TiTLE | set %show_Spec_EP. [ $+ [ %num ] ] %TVRead_EP | set %show_Spec_Airdate. [ $+ [ %num ] ] %TVRead_DATE | set %show_Spec_Airdate+. [ $+ [ %num ] ] $replace(%show_Spec_Airdate. [ $+ [ %num ] ],Jan,01,Feb,02,Mar,03,Apr,04,May,05,Jun,06,Jul,07,Aug,08,Sep,09,Oct,10,Nov,11,Dec,12) }
  171.   ;**********************************************************************************************************************************
  172.   ;*** Last + Next
  173.   elseif ($regex($strip(%TVRead),/Latest Episode@(.*)/)) || ($regex($strip(%TVRead),/Next Episode@(.*)/)) { set -u3 %TVRead+ $gettok(%TVRead,2,64) | set -u3 %TVRead_DATE $gettok(%TVRead+,3,94) | set -u3 %TVRead_EP $gettok(%TVRead+,1,94) | set -u3 %TVRead_TiTLE $gettok(%TVRead+,2,94) | $iif(Latest Episode@ isin %TVRead,set %show_Last. [ $+ [ %num ] ],set %show_Next. [ $+ [ %num ] ]) $+(14,$replace(%TVRead_EP,x,15x14)) $iif(%TVRead_TiTLE,14-4#14- $+(15,$v1)) | $iif(Latest Episode@ isin %TVRead,set %show_Last_Title. [ $+ [ %num ] ],set %show_Next_Title. [ $+ [ %num ] ]) %TVRead_TiTLE | $iif(Latest Episode@ isin %TVRead,set %show_Last_EP. [ $+ [ %num ] ],set %show_Next_EP. [ $+ [ %num ] ]) %TVRead_EP | $iif(Latest Episode@ isin %TVRead,set %show_Last_Airdate. [ $+ [ %num ] ],set %show_Next_Airdate. [ $+ [ %num ] ]) $+($GetTok(%TVRead_DATE,2,47),/,$GetTok(%TVRead_DATE,1,47),/,$GetTok(%TVRead_DATE,3,47)) | $iif(Latest Episode@ isin %TVRead,set %show_Last_Airdate+. [ $+ [ %num ] ],set %show_Next_Airdate+. [ $+ [ %num ] ]) $replace($iif(Latest Episode@ isin %TVRead,%show_Last_Airdate. [ $+ [ %num ] ],%show_Next_Airdate. [ $+ [ %num ] ]),Jan,01,Feb,02,Mar,03,Apr,04,May,05,Jun,06,Jul,07,Aug,08,Sep,09,Oct,10,Nov,11,Dec,12)) | $iif(%show_Ended. [ $+ [ %num ] ] != $null,$iif(Latest Episode@ isin %TVRead && $len(%show_Ended. [ $+ [ %num ] ]) >= 11,set %show_Ended. [ $+ [ %num ] ] $+($gettok(%show_Ended. [ $+ [ %num ] ],2,47),/,$gettok(%show_Ended. [ $+ [ %num ] ],1,47),/,$gettok(%show_Ended. [ $+ [ %num ] ],3,47)),set %show_Ended. [ $+ [ %num ] ] %show_Last_Airdate. [ $+ [ %num ] ]),unset %show_Ended. [ $+ [ %num ] ]) }
  174.   ;**********************************************************************************************************************************
  175.   ;*** Airtime (cTime)
  176.   elseif ($regex($strip(%TVRead),/Airtime@(.*)/)) { set %show_Airtime. [ $+ [ %num ] ] $replace($regml(1),day,days,pm,PM,am,AM) | $iif(%show_Spec_Airdate+. [ $+ [ %num ] ],set %show_Spec_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) | $iif(%show_Last_Airdate+. [ $+ [ %num ] ],set %show_Last_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) | $iif(%show_Next_Airdate+. [ $+ [ %num ] ],set %show_Next_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) }
  177.   ;**********************************************************************************************************************************
  178.   ;*** Runtime ( sockclose )
  179.   elseif ($regex($strip(%TVRead),/Runtime@(.*)/)) { set %show_Runtime. [ $+ [ %num ] ] $regml(1) | sockclose $sockname | Check.Settings Ep %Num
  180.     ;*** !SHOW
  181.     if (%TVRage_ONLY. [ $+ [ %num ] ] == SHOW) && (%show_ID. [ $+ [ %num ] ]) { $iif(%show_ID. [ $+ [ %num ] ] != $null,TVRage %num $v1) | halt }
  182.     ;**********************************************************************************************************************************
  183.     ;*** ERROR - $iif(%show_Last_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))))
  184.     elseif (!%show_Next. [ $+ [ %num ] ]) && (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT) { goto TVRage_iNFO }
  185.     elseif (!%show_Next. [ $+ [ %num ] ]) && (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT) { msg %TVRage_Target. [ $+ [ %num ] ] No information available for $+(5,%show_name. [ $+ [ %num ] ],) $+(15,$chr(40),14,$left(%show_Last_EP. [ $+ [ %num ] ],2),15x14,$calc($mid(%show_Last_EP. [ $+ [ %num ] ],4,2) +1),15,$chr(41),) 14-4#14- 5Reason: $iif(!%show_Ended. [ $+ [ %num ] ],Unknown... might not be schedule yet $+(15,$chr(40),%show_Status. [ $+ [ %num ] ],15,$chr(41),),$iif(%show_Last_cTime. [ $+ [ %num ] ],The show sadly ended $+(15,$replacex($duration($calc($cTime -$v1)),wks,14weeks15,wk,14week15,days,14days15,day,14day15,hrs,14hours15,hr,14hour15,mins,14minutes15,min,14minute,secs,14seconds,sec,14second) 14ago),Sadly this show has either ended or been canceled)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),)) | goto ENDiTNOW }
  186.     elseif (%TVRage_Type. [ $+ [ %num ] ] == EPSpec) && ((%Check_Season. [ $+ [ %num ] ]) || (%Check_EP. [ $+ [ %num ] ])) && (!%show_Spec_EP. [ $+ [ %num ] ]) { msg %TVRage_Target. [ $+ [ %num ] ] No information available for $+(5,%show_name. [ $+ [ %num ] ],) $+(15,$chr(40),14,$iif($len(%Check_Season. [ $+ [ %num ] ]) == 1,0),%Check_Season. [ $+ [ %num ] ],15x14,$iif($len(%Check_EP. [ $+ [ %num ] ]) == 1,0),%Check_EP. [ $+ [ %num ] ],15,$chr(41),) 14-4#14- 5Reason: Not that many episodes in the $+(14,$ord(%Check_Season. [ $+ [ %num ] ]),) season $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,/episode_list/,%Check_Season. [ $+ [ %num ] ],15,$chr(41),)) | goto ENDiTNOW }
  187.     ;**********************************************************************************************************************************
  188.     ;*** EPSpecs
  189.     elseif (%show_Spec_EP. [ $+ [ %num ] ] != $null) { msg %TVRage_Target. [ $+ [ %num ] ] $+(05,%show_name. [ $+ [ %num ] ],) 14-4#14- %show_Spec. [ $+ [ %num ] ] $iif(%show_Spec_cTime. [ $+ [ %num ] ] > $cTime,5Airing in:,5Aired:) $iif(%show_Spec_cTime. [ $+ [ %num ] ] != $null,$LongTime+($calc($cTime -$cTime(%show_Spec_Airdate+. [ $+ [ %num ] ])))) $iif(%show_Spec_cTime. [ $+ [ %num ] ] < $cTime,ago) $+($chr(40),15,$replace(%show_Spec_Airdate+. [ $+ [ %num ] ],/,14/15),,$chr(41)) $iif(%show_URL. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,$v1,15,$chr(41),))) | $iif(%show_URL. [ $+ [ %num ] ] != $null,TVPlot %TVRage_Target. [ $+ [ %num ] ] %show_URL. [ $+ [ %num ] ]) | goto ENDiTNOW }
  190.     ;*** SHOW iNFO / MSG
  191.     elseif (!%TVRage_ONLY. [ $+ [ %num ] ]) { :TVRage_iNFO | $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [ $+(05,%show_name. [ $+ [ %num ] ]) ] $iif(%show_Ended. [ $+ [ %num ] ] != $null,Ended and/or canceled 14-4#14- $LongTime+($calc($cTime -$cTime($SetMonth(%show_Ended. [ $+ [ %num ] ])))) ago $+($chr(40),15,$replace(%show_Ended. [ $+ [ %num ] ],/,14/15),,$chr(41)),$iif(%show_Airtime. [ $+ [ %num ] ],$+(4,$v1,))) $iif(%show_Class. [ $+ [ %num ] ],$+(,$chr(40),15,$v1,,$chr(41),)) $iif(%show_Genre. [ $+ [ %num ] ],$+(14,$replace($v1,|,15/14),)) $iif(!%show_Ended. [ $+ [ %num ] ],since,from) $+(7,%show_Started. [ $+ [ %num ] ],$iif($len(%show_Ended. [ $+ [ %num ] ]) == 11 && %show_Started. [ $+ [ %num ] ] !isin %show_Ended. [ $+ [ %num ] ],$+(14-07,$gettok($v2,3,47))),) $iif(!%show_Ended. [ $+ [ %num ] ],$+(,$chr(40),%show_Status. [ $+ [ %num ] ],,$chr(41),)) $iif(%show_Network. [ $+ [ %num ] ] != $null,$iif(!%show_Ended. [ $+ [ %num ] ],airs,aired) on $+(7,$iif(%show_Country. [ $+ [ %num ] ] !isin %show_Network. [ $+ [ %num ] ],$v2 $+(15,$chr(40),07,$v1,15,$chr(41)),$replace($v2,$chr(40),$+(15,$chr(40),07),$chr(41),$+(15,$chr(41)))),)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),))) | $iif(!%show_Next. [ $+ [ %num ] ] && %TVRage_ONLY. [ $+ [ %num ] ] == NEXT,goto TVRage_LAST) }
  192.     ;*** !LAST
  193.     if ((!%TVRage_ONLY. [ $+ [ %num ] ]) || (%TVRage_ONLY. [ $+ [ %num ] ] == LAST)) && (%show_Last. [ $+ [ %num ] ] != $null) { :TVRage_LAST | msg %TVRage_Target. [ $+ [ %num ] ] $iif(%TVRage_ONLY. [ $+ [ %num ] ] == LAST,$+(5,%show_name. [ $+ [ %num ] ],) 14-4#14-,5Last Episode) %show_Last. [ $+ [ %num ] ] $iif(%show_Last_cTime. [ $+ [ %num ] ],5Aired: $+(15,$LongTime+($calc($cTime -$v1)) 14ago)) $iif(%show_Last_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))) $iif(%TVRage_ONLY. [ $+ [ %num ] ] == LAST && %Show_link. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,%Show_link. [ $+ [ %num ] ],15,$chr(41),))) }
  194.     ;*** !NEXT
  195.     if (%show_Next. [ $+ [ %num ] ] != $null) && ((!%TVRage_ONLY. [ $+ [ %num ] ]) || (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT)) { msg %TVRage_Target. [ $+ [ %num ] ] $iif(%TVRage_ONLY. [ $+ [ %num ] ] == NEXT,$+(5,%show_name. [ $+ [ %num ] ]) 14-4#14-,5Next Episode) $+(%show_Next. [ $+ [ %num ] ],) $iif(%show_Next_cTime. [ $+ [ %num ] ] > $cTime,5Airing in: $+($LongTime+($calc($v1 -$cTime)),),5Aired: $+($LongTime+($calc($cTime -$v1)),)) $iif(%show_Next_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))) $iif(%TVRage_ONLY. [ $+ [ %num ] ] == NEXT && %Show_link. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,%Show_link. [ $+ [ %num ] ],15,$chr(41),)))) }
  196.     :ENDiTNOW
  197.     unset %TVRead* %tvshow* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ] %TVRage_* [ $+ [ %num ] ] %Check_* [ $+ [ %num ] ] %next_* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ]
  198.   }
  199. }
  200. on *:sockclose:TVRage.*:{ var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  201.   ;**** !TODAY / !TOMORROW ( As in program schedule )
  202.   if ((%TVRage_Type. [ $+ [ %num ] ] = Schedule) || (%TVRage_Type. [ $+ [ %num ] ] = Country)) { Check.Settings Sch %Num | if (%TVRage_Date. [ $+ [ %num ] ] != $null) { .fopen %TVRage_Date. [ $+ [ %num ] ] [ %TVRage_Date. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt | set -u17 %TVRage_DATE+ [ $+ [ %num ] ] $+(15,$fread(%TVRage_Date. [ $+ [ %num ] ])) | while ($Feof != 1) { set -u2 %TVRage_Tmp. [ $+ [ %num ] ] $Fread(%TVRage_Date. [ $+ [ %num ] ]) | set -u2 %TVRage_Time_Temp. [ $+ [ %num ] ] $remove(%TVRage_Tmp. [ $+ [ %num ] ],$GetTok(%TVRage_Tmp. [ $+ [ %num ] ],2,93),[,]) | if (!%NOTHiNGFOUD) { set -u17 %NOTHiNGFOUD 1 | .TiMER-TV-SCHEDULE 1 3 $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [4ERROR] 14There are no new TV Shows Scheduled for $+(04,%TVRage_Time_Schedule. [ $+ [ %num ] ],15:0400 $iif(%TVRage_Time_Schedule. [ $+ [ %num ] ] < 12,14PM,14AM),) } | if (%TVRage_Time_Schedule. [ $+ [ %num ] ] == $null) || ((%TVRage_Time_Schedule. [ $+ [ %num ] ] != $null) && ($mid($strip(%TVRage_Time_Temp. [ $+ [ %num ] ]),1,2) == $int($replacex($mid(%TVRage_Time_Schedule. [ $+ [ %num ] ],1,2),5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00)))) { .TiMER-TV-SCHEDULE OFF | $iif(%NOTHiNGFOUD == 1,$iif(%TVRage_Target. [ $+ [ %num ] ],.msg $v1,echo -at) 05Schedule for %TVRage_DATE+ [ $+ [ %num ] ] $iif(%TVRage_Time_Schedule. [ $+ [ %num ] ],5at $+(15,$replacexcs($v1,5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00),14:1500) $iif($replacexcs(%TVRage_Time_Schedule. [ $+ [ %num ] ],5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00) > 12,14PM,14AM))) | $iif(%TVRage_Target. [ $+ [ %num ] ],.msg $v1,echo -at) $replaceLiNK(%TVRage_Tmp. [ $+ [ %num ] ]) | inc -u3 %NOTHiNGFOUD } } } | .fclose %TVRage_Date. [ $+ [ %num ] ] | .remove [ %TVRage_Date. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt }
  203.   .unset %tvshow* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ] %TVRage_* [ $+ [ %num ] ] %Check_* [ $+ [ %num ] ] %next_* [ $+ [ %num ] ]
  204. }
  205. ;**********************************************************************************************************************************
  206. ;*** TVPlot
  207. alias TVPlot { set -u5 %CHAN $1 | $iif($2,set %TVPlot-Link $remove($2,www.tvrage.com,http://)) | sockClose TVPlot | sockOpen TVPlot www.tvrage.com 80 }
  208. on *:SockOpen:TVPlot: { sockwrite -nt TVPlot GET $iif(%TVPlot-Link,$v1,/House/episodes/1064858782) HTTP/1.1 | sockwrite -nt TVPlot Host: www.tvrage.com | sockwrite -nt TVPlot $crlf | unset %TVPlot-Link }
  209. on *:SockRead:TVPlot: { tokenize 32 $sock($sockname).mark | var %read | sockRead %read | if (<span class="addthis_toolbox addthis_default_style "> isin %read) { set -u1 %Plot $noHTML($v2) | $iif(Source: isin %Plot,set -u1 %Plot $mid($noHTML(%read),1,$pos($noHTML(%read),.Source:))) | $iif(%Plot != $null,$iif(%CHAN,mCuttext $v1,echo -at) 5Summary: $iif(Click Here To Add isin %Plot,Not availible for this episode,%Plot)) } }
  210. ;**********************************************************************************************************************************
  211. ;*** Dialog section
  212. dialog -l TVSettings {
  213.   title "TVRage Settings"
  214.   size -1 -1 264 217
  215.   option pixels
  216.   box "", 1, 8 8 249 60
  217.   box "", 2, 8 67 249 60
  218.   box "", 3, 8 126 249 43
  219.   box "", 12, 8 168 249 43
  220.   text "Select where you want the Schedule Displayed", 4, 16 21 225 17
  221.   radio "Channel", 5, 32 45 65 13, group
  222.   radio "Private Message", 6, 128 45 105 13,
  223.   text "Select where you want the Replys Displayed", 7, 16 80 225 17
  224.   radio "Channel", 8, 32 104 65 13, group
  225.   radio "Private Message", 9, 128 104 105 13,
  226.   check "Enable TVRage", 10, 32 188 113 13
  227.   button "&Save Settings", 11, 144 182 89 25, ok
  228.   check "Enable Colors", 13, 32 145 113 13
  229. }
  230. on *:dialog:TVSettings:*:*:{
  231.   if ($Devent == init) {
  232.     if (%TV_Where = 1) { did -c $dname 8 }
  233.     else { did -c $dname 9 }
  234.     if (%TV_Where2 = 1) { did -c $dname 5 }
  235.     else { did -c $dname 6 }
  236.     if (%TV_Rage = 1) { did -c $dname 10 }
  237.     else { did -u $dname 10 }
  238.     if (%TV_Color = 1) { did -c $dname 13 }
  239.     else { did -u $dname 13 }
  240.   }
  241.   elseif ($devent == Close) {
  242.     set %TV_Where $iif($Did($Dname,8).state = 1,1,0)
  243.     set %TV_Where2 $iif($Did($Dname,5).state = 1,1,0)      
  244.     set %TV_Rage $iif($Did($Dname,10).state = 1,1,0)
  245.     set %TV_Color $iif($Did($Dname,13).state = 1,1,0)
  246.     echo -at 14TVRage Settings have been saved.
  247.   }
  248. }
  249. dialog -l SelfSearch {
  250.   title "TVRage Search"
  251.   size -1 -1 500 202
  252.   option pixels
  253.   box "", 1, 8 8 486 145
  254.   box "", 2, 8 152 486 43
  255.   text "Search Options:", 3, 16 16 462 17
  256.   text "<Show> (Season and Episode) EX: House 2x05", 4, 30 33 462 17
  257.   text "Schedule <Day of Week> EX: Schedule Fri", 5, 30 50 462 17
  258.   text "Schedule <Day of Week> (Time)  EX: Schedule Wed 10", 6, 30 67 462 17
  259.   text "Schedule <Day of Week> (Time) (Country:US,GB,UK,AU) EX: Schedule Saturday 10 GB", 7, 30 84 462 17
  260.   text "Option in ( ) are Optional. Options in < > are Required.", 8, 30 101 462 17
  261.   edit "", 9, 16 125 462 17, autohs
  262.   button "Search", 10, 335 165 65 25
  263.   button "Cancel", 11, 414 165 65 25, cancel
  264. }
  265. on *:dialog:SelfSearch:sclick:*:{
  266.   if ($Did = 10) && ($Did(9) = $null) && ($dialog(error,error,-4)) { did -f $Dname 9 }
  267.   elseif ($Did = 10)  { var %Num = $trnum | set %TVRage_Target. [ $+ [ %num ] ] $me | set %TVRage_Nick. [ $+ [ %num ] ] $me | set %TVRage_Chan. [ $+ [ %num ] ] $me | TVRage.Load %num !ep $did(9).text | echo -at Check you Private Message for the infomation that you requested | dialog -x $dname }
  268. }
  269. dialog -l error {
  270.   title "Error"
  271.   size -1 -1 228 90
  272.   option pixels
  273.   box "", 2, 8 8 214 33
  274.   box "", 3, 8 40 214 43
  275.   button "&Ok", 4, 160 52 50 25, ok
  276.   text "DOH! - You must type something to search for!", 5, 20 20 190 17
  277. }
  278. ;*** END TVRage section ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment