<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17776" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2010-05-18T15:10:33-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17776</id>

		<entry>
		<author><name><![CDATA[luminoso]]></name></author>
		<updated>2010-05-18T15:10:33-04:00</updated>

		<published>2010-05-18T15:10:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93115#p93115</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93115#p93115"/>
		<title type="html"><![CDATA[dlx's tvrage LOOKUP SCRIPT (v2.3fix)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93115#p93115"><![CDATA[
thank you!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9114">luminoso</a> — Tue May 18, 2010 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Znuff]]></name></author>
		<updated>2010-05-17T04:26:22-04:00</updated>

		<published>2010-05-17T04:26:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93106#p93106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93106#p93106"/>
		<title type="html"><![CDATA[dlx's tvrage LOOKUP SCRIPT (v2.3fix)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93106#p93106"><![CDATA[
if the above code doesn't really work for you (it worked for me, but not for a friend...), try this one:<br><br><div class="codebox"><p>Code: </p><pre><code>############################################################ tvrage LOOKUP SCRIPT (dlx @ linknet)                    ############################################################# v2.3fix - changed API url                               ##         - added timeout after 5 seconds (stops crashing ##           if tvrage.com is slow                         ##         - modified by znuff on 17/05/2010               ############################################################# v2.3 - changed the way !today and                       ##        !tomorrow reply for less spam                    ############################################################# v2.2 - added tvrage(inline) support                     ##        for iPoRn                                        ############################################################# v2.1 - added time output to !tonight                    ##         and !tomorrow for nogruk                        ############################################################# v2.0 - new commands !next/!last/                        ##                !tonight/!tomorrow                       ############################################################bind pub - .tv dlx:tvrage:tvbind pub - .tvnext dlx:tvrage:nextbind pub - .tvlast dlx:tvrage:last#bind pub - .tvtonight dlx:tvrage:tonight#bind pub - .tvtomorrow dlx:tvrage:tomorrow# Channels not to be displayed on !tonight/!tomorrowset tvrage(excluded_Channels) [list "Nickelodeon" "Disney Channel" "Style" "VH1" "HGTV" "PBS" "Cooking Channel" "Food Network" "TLC" "Discovery Channel" "Spike TV" "E!" "A&amp;E" "Cartoon Network" "Animal Planet"]# timeout value - in milisecondsset tvrage(timeout) "5000"# Show the Time of the show?set tvrage(show_time) "TRUE"# Show the Episode number of the show?set tvrage(show_episode) "TRUE"# Display !tonight and !tomorrow in one line?# TRUE will squeeze all shows into one line# FALSE will split them up by channel (DEFAULT)set tvrage(inline) "FALSE"proc dlx:tvrage:tv { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "     set arg [string map { " " "%20" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]    regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    regexp {Show URL@http://www.tvrage.com/([A-Za-z_0-9/-]+)} $page goturl show_url    regexp {Premiered@([0-9]+)} $page gotpremiere show_premiered    regexp {Latest Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:\.,]+)\^([A-Za-z0-9/]+)} $page gotlatest latest_ep latest_ep_title latest_ep_date    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    regexp {Country@([A-Za-z]+)} $page gotcountry show_country    regexp {Status@([A-Za-z/ ]+)} $page gotstatus show_status    regexp {Classification@([A-Za-z ]+)} $page gotclassification show_classification    set gotgenres [regexp {Genres@([A-Za-z |]+)} $page gotgenres show_genres]    regexp {Network@([A-Za-z 0-9]+)} $page gotnetwork show_network    regexp {Airtime@([A-Za-z, 0-9:]+)} $page gotairtime show_airtime    if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"    #   return -1    }    set show_url "http://www.tvrage.com/$show_url"    if { $gotgenres == 0 } { set show_genres "N/A" }    if { $gotnext == 0 } {            set next_ep "00x00"            set next_ep_title "-N/A-"            set next_ep_date "not available"    }   putquick "PRIVMSG $chan :$prefix Show: $show_name ($show_classification \| $show_genres)"   putquick "PRIVMSG $chan :$prefix Premiered: $show_premiered"   putquick "PRIVMSG $chan :$prefix Status: $show_status"   putquick "PRIVMSG $chan :$prefix Network: $show_network"   putquick "PRIVMSG $chan :$prefix URL: $show_url"}proc dlx:tvrage:next { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "    set arg [string map { " " "_" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]     regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    regexp {Airtime@([A-Za-z, 0-9:]+)} $page gotairtime show_airtime        if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"    #   return -1    }    if { $gotnext == 0 } {      putquick "PRIVMSG $chan :$prefix The next episode of \002$show_name\002 is not yet scheduled. That makes me a sad panda :("    } else {   putquick "PRIVMSG $chan :$prefix The next episode of \002$show_name\002 is \002$next_ep_title \[$next_ep\]\002, it will air on \002$show_airtime\002 \002$next_ep_date\002"   }} proc dlx:tvrage:last { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "    set arg [string map { " " "_" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]     regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    regexp {Latest Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:\.,]+)\^([A-Za-z0-9/]+)} $page gotlatest latest_ep latest_ep_title latest_ep_date    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"    #   return -1    }       putquick "PRIVMSG $chan :$prefix The last episode of \002$show_name\002 is \002$latest_ep_title $latest_ep\ \002 it aired on \002$latest_ep_date\002"}proc dlx:tvrage:tonight { nick host hand chan arg } {   global tvrage   if { [info exists chans] } { unset chans }   package require http   set prefix "\002\0037TV -&gt;\003\002 "   set schedule [http::data [http::geturl "http://www.tvrage.com/quickschedule.php" -timeout $tvrage(timeout)]]   set end [string first "\n\n" $schedule]   set today [string range $schedule 0 $end]   putquick "PRIVMSG $chan :$prefix TV Schedule for Today:"   set showList "$prefix "   foreach line [split $today "\n"] {      set found_time [regexp {\[TIME\](.*)\[\/TIME\]} $line found_time time]      set found_show [regexp {\[SHOW\](.*)\^(.*)\^(.*)\^(.*)\[\/SHOW\]} $line found_show show_channel show_name show_ep show_url]      if { $found_show &amp;&amp; [lsearch -exact $tvrage(excluded_Channels) $show_channel] == -1 } {         if { $tvrage(inline) } {            append showList "$show_name ($show_ep) - "         } else {            if {$tvrage(show_time)} { append chans($show_channel) "\037$time\037 " }            append chans($show_channel) "\002$show_name\002 "            if {$tvrage(show_episode)} { append chans($show_channel) "($show_ep) " }         }      }   }   if { $tvrage(inline) } {      set showList [string range $showList 0 [expr [string length $showList] - 3]]      putquick "PRIVMSG $chan :$showList"   } else {      set chanlist [array names chans]      foreach x $chanlist {         putquick "PRIVMSG $chan :$x\: $chans($x)"      }   }}proc dlx:tvrage:tomorrow { nick host hand chan arg } {   global tvrage   if { [info exists chans] } { unset chans }   package require http   set prefix "\002\0037TV -&gt;\003\002 "   set schedule [http::data [http::geturl "http://www.tvrage.com/quickschedule.php" -timeout $tvrage(timeout)]]   set start [string first "\n\n" $schedule]   set schedule [string range $schedule [expr $start+3] end]   set end [string first "\n\n" $schedule]   set tomorrow [string range $schedule 0 $end]   putquick "PRIVMSG $chan :$prefix TV Schedule for Tomorrow:"   set showList "$prefix "   foreach line [split $tomorrow "\n"] {      set found_time [regexp {\[TIME\](.*)\[\/TIME\]} $line found_time time]      set found_show [regexp {\[SHOW\](.*)\^(.*)\^(.*)\^(.*)\[\/SHOW\]} $line found_show show_channel show_name show_ep show_url]      if { $found_show &amp;&amp; [lsearch -exact $tvrage(excluded_Channels) $show_channel] == -1 } {         if { $tvrage(inline) == "TRUE" } {            append showList "$show_name ($show_ep) - "         } else {            if {$tvrage(show_time)} { append chans($show_channel) "\037$time\037 " }            append chans($show_channel) "\002$show_name\002 "            if {$tvrage(show_episode)} { append chans($show_channel) "($show_ep) " }         }      }   }   if { $tvrage(inline) == "TRUE" } {      set showList [string range $showList 0 [expr [string length $showList] - 3]]      putquick "PRIVMSG $chan :$showList"   } else {      set chanlist [array names chans]      foreach x $chanlist {         putquick "PRiVmsg $chan :$x\: $chans($x)"      }   }}putlog "dlx-tvrage_v2.3f.tcl loaded. enjoy!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11219">Znuff</a> — Mon May 17, 2010 4:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Znuff]]></name></author>
		<updated>2010-05-17T01:53:57-04:00</updated>

		<published>2010-05-17T01:53:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93105#p93105</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93105#p93105"/>
		<title type="html"><![CDATA[dlx's tvrage LOOKUP SCRIPT (v2.3fix)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93105#p93105"><![CDATA[
Hi,<br><br>Code is not mine, but dlx's. Just changed the api url and added a timeout value so the bot doesn't crash anymore if the service is unresponsive.<br><br>Wished I could write better error handling, but this will do, I guess <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>############################################################ tvrage LOOKUP SCRIPT (dlx @ linknet)                    ############################################################# v2.3fix - changed API url                               ##         - added timeout after 5 seconds (stops crashing ##           if tvrage.com is slow                         ##         - modified by znuff on 17/05/2010               ############################################################# v2.3 - changed the way !today and                       ##        !tomorrow reply for less spam                    ############################################################# v2.2 - added tvrage(inline) support                     ##        for iPoRn                                        ############################################################# v2.1 - added time output to !tonight                    ##         and !tomorrow for nogruk                        ############################################################# v2.0 - new commands !next/!last/                        ##                !tonight/!tomorrow                       ############################################################bind pub - .tv dlx:tvrage:tvbind pub - .tvnext dlx:tvrage:nextbind pub - .tvlast dlx:tvrage:last#bind pub - .tvtonight dlx:tvrage:tonight#bind pub - .tvtomorrow dlx:tvrage:tomorrow# Channels not to be displayed on !tonight/!tomorrowset tvrage(excluded_Channels) [list "Nickelodeon" "Disney Channel" "Style" "VH1" "HGTV" "PBS" "Cooking Channel" "Food Network" "TLC" "Discovery Channel" "Spike TV" "E!" "A&amp;E" "Cartoon Network" "Animal Planet"]# timeout value - in milisecondsset tvrage(timeout) "5000"# Show the Time of the show?set tvrage(show_time) "TRUE"# Show the Episode number of the show?set tvrage(show_episode) "TRUE"# Display !tonight and !tomorrow in one line?# TRUE will squeeze all shows into one line# FALSE will split them up by channel (DEFAULT)set tvrage(inline) "FALSE"proc dlx:tvrage:tv { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "     set arg [string map { " " "%20" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]    regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    regexp {Show URL@http://www.tvrage.com/([A-Za-z_0-9/-]+)} $page goturl show_url    regexp {Premiered@([0-9]+)} $page gotpremiere show_premiered    regexp {Latest Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:\.,]+)\^([A-Za-z0-9/]+)} $page gotlatest latest_ep latest_ep_title latest_ep_date    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    regexp {Country@([A-Za-z]+)} $page gotcountry show_country    regexp {Status@([A-Za-z/ ]+)} $page gotstatus show_status    regexp {Classification@([A-Za-z ]+)} $page gotclassification show_classification    set gotgenres [regexp {Genres@([A-Za-z |]+)} $page gotgenres show_genres]    regexp {Network@([A-Za-z 0-9]+)} $page gotnetwork show_network    regexp {Airtime@([A-Za-z, 0-9:]+)} $page gotairtime show_airtime    if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"       return -1    }    set show_url "http://www.tvrage.com/$show_url"    if { $gotgenres == 0 } { set show_genres "N/A" }    if { $gotnext == 0 } {            set next_ep "00x00"            set next_ep_title "-N/A-"            set next_ep_date "not available"    }   putquick "PRIVMSG $chan :$prefix Show: $show_name ($show_classification \| $show_genres)"   putquick "PRIVMSG $chan :$prefix Premiered: $show_premiered"   putquick "PRIVMSG $chan :$prefix Status: $show_status"   putquick "PRIVMSG $chan :$prefix Network: $show_network"   putquick "PRIVMSG $chan :$prefix URL: $show_url"}proc dlx:tvrage:next { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "    set arg [string map { " " "_" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]     regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    regexp {Airtime@([A-Za-z, 0-9:]+)} $page gotairtime show_airtime        if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"       return -1    }    if { $gotnext == 0 } {      putquick "PRIVMSG $chan :$prefix The next episode of \002$show_name\002 is not yet scheduled. That makes me a sad panda :("    } else {   putquick "PRIVMSG $chan :$prefix The next episode of \002$show_name\002 is \002$next_ep_title \[$next_ep\]\002, it will air on \002$show_airtime\002 \002$next_ep_date\002"   }} proc dlx:tvrage:last { nick host hand chan arg } {    global tvrage    package require http    set prefix "\002\0037TV -&gt;\003\002 "    set arg [string map { " " "_" } $arg]     set url "http://services.tvrage.com/tools/quickinfo.php?show=$arg"    set page [http::data [http::geturl $url -timeout $tvrage(timeout)]]     regexp {Show Name@([A-Za-z 0-9\&amp;\':]+)} $page gotname show_name    regexp {Latest Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:\.,]+)\^([A-Za-z0-9/]+)} $page gotlatest latest_ep latest_ep_title latest_ep_date    set gotnext [regexp {Next Episode@([0-9x]+)\^([A-Za-z0-9 -\`\"\'\&amp;:.,]+)\^([A-Za-z0-9/]+)} $page gotnext next_ep next_ep_title next_ep_date]    if { ![info exists show_name] } {       putquick "PRIVMSG $chan :$prefix Error! (timeout or something similar)"       return -1    }       putquick "PRIVMSG $chan :$prefix The last episode of \002$show_name\002 is \002$latest_ep_title $latest_ep\ \002 it aired on \002$latest_ep_date\002"}proc dlx:tvrage:tonight { nick host hand chan arg } {   global tvrage   if { [info exists chans] } { unset chans }   package require http   set prefix "\002\0037TV -&gt;\003\002 "   set schedule [http::data [http::geturl "http://www.tvrage.com/quickschedule.php" -timeout $tvrage(timeout)]]   set end [string first "\n\n" $schedule]   set today [string range $schedule 0 $end]   putquick "PRIVMSG $chan :$prefix TV Schedule for Today:"   set showList "$prefix "   foreach line [split $today "\n"] {      set found_time [regexp {\[TIME\](.*)\[\/TIME\]} $line found_time time]      set found_show [regexp {\[SHOW\](.*)\^(.*)\^(.*)\^(.*)\[\/SHOW\]} $line found_show show_channel show_name show_ep show_url]      if { $found_show &amp;&amp; [lsearch -exact $tvrage(excluded_Channels) $show_channel] == -1 } {         if { $tvrage(inline) } {            append showList "$show_name ($show_ep) - "         } else {            if {$tvrage(show_time)} { append chans($show_channel) "\037$time\037 " }            append chans($show_channel) "\002$show_name\002 "            if {$tvrage(show_episode)} { append chans($show_channel) "($show_ep) " }         }      }   }   if { $tvrage(inline) } {      set showList [string range $showList 0 [expr [string length $showList] - 3]]      putquick "PRIVMSG $chan :$showList"   } else {      set chanlist [array names chans]      foreach x $chanlist {         putquick "PRIVMSG $chan :$x\: $chans($x)"      }   }}proc dlx:tvrage:tomorrow { nick host hand chan arg } {   global tvrage   if { [info exists chans] } { unset chans }   package require http   set prefix "\002\0037TV -&gt;\003\002 "   set schedule [http::data [http::geturl "http://www.tvrage.com/quickschedule.php" -timeout $tvrage(timeout)]]   set start [string first "\n\n" $schedule]   set schedule [string range $schedule [expr $start+3] end]   set end [string first "\n\n" $schedule]   set tomorrow [string range $schedule 0 $end]   putquick "PRIVMSG $chan :$prefix TV Schedule for Tomorrow:"   set showList "$prefix "   foreach line [split $tomorrow "\n"] {      set found_time [regexp {\[TIME\](.*)\[\/TIME\]} $line found_time time]      set found_show [regexp {\[SHOW\](.*)\^(.*)\^(.*)\^(.*)\[\/SHOW\]} $line found_show show_channel show_name show_ep show_url]      if { $found_show &amp;&amp; [lsearch -exact $tvrage(excluded_Channels) $show_channel] == -1 } {         if { $tvrage(inline) == "TRUE" } {            append showList "$show_name ($show_ep) - "         } else {            if {$tvrage(show_time)} { append chans($show_channel) "\037$time\037 " }            append chans($show_channel) "\002$show_name\002 "            if {$tvrage(show_episode)} { append chans($show_channel) "($show_ep) " }         }      }   }   if { $tvrage(inline) == "TRUE" } {      set showList [string range $showList 0 [expr [string length $showList] - 3]]      putquick "PRIVMSG $chan :$showList"   } else {      set chanlist [array names chans]      foreach x $chanlist {         putquick "PRiVmsg $chan :$x\: $chans($x)"      }   }}putlog "dlx-tvrage_v2.3f.tcl loaded. enjoy!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11219">Znuff</a> — Mon May 17, 2010 1:53 am</p><hr />
]]></content>
	</entry>
	</feed>
