<?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/12288" />

	<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>2009-10-18T23:27:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Jonathan1683]]></name></author>
		<updated>2009-10-18T23:27:26-04:00</updated>

		<published>2009-10-18T23:27:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90559#p90559</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90559#p90559"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90559#p90559"><![CDATA[
is there any way to get a new copy of this script? I really doubt it works if its three years old and the newest link was dead <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10090">Jonathan1683</a> — Sun Oct 18, 2009 11:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cletus]]></name></author>
		<updated>2006-08-18T14:57:17-04:00</updated>

		<published>2006-08-18T14:57:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65599#p65599</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65599#p65599"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65599#p65599"><![CDATA[
You the man incith, thanks a bunch!  I use a lot of your other scripts too, I really appreciate it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8062">Cletus</a> — Fri Aug 18, 2006 2:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[incith]]></name></author>
		<updated>2006-10-05T18:20:56-04:00</updated>

		<published>2006-08-18T11:27:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65593#p65593</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65593#p65593"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65593#p65593"><![CDATA[
Oops, it was easier than I thought: <a href="http://incith.incith.com/eggdrop/tsnstats-0.7-unofficial.tar.gz" class="postlink">tsnstats-0.7-unofficial.tar.gz</a><blockquote class="uncited"><div>(09:25:20) (@incith) !pga duke<br>(09:25:22) &lt;@visitant&gt;  Ken Duke [6-1 205lbs] 37yo. Born Jan 29, 1969 in Hope, AR.</div></blockquote><blockquote class="uncited"><div>(09:24:29) (@incith) !nfl dan<br>(09:24:31) &lt;@visitant&gt; Found 8 matches: Owen Daniels, P.J. Daniels, Phillip Daniels, Torrance Daniels, Travis Daniels, Lane Danielsen, Karlos Dansby, Woodrow Dantzler</div></blockquote>The changes made were the ones mentioned in the above post more or less.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6130">incith</a> — Fri Aug 18, 2006 11:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[incith]]></name></author>
		<updated>2006-08-18T11:18:43-04:00</updated>

		<published>2006-08-18T11:18:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65592#p65592</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65592#p65592"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65592#p65592"><![CDATA[
Removing these would be a start:<div class="codebox"><p>Code: </p><pre><code>if { $sport == "nfl" } { set input(lookupurl) "http://www.tsn.ca/nfl/player_list.asp?letter=[string index $input(name) 0]" }    if { $sport == "pga" } { set input(lookupurl) "http://www.tsn.ca/golf/player_list.asp?letter=[string index $input(name) 0]" }</code></pre></div>At least from what I can tell, the tsn page doesn't use player_list.asp anymore for NFL &amp; Golf, and uses the same format of /players/?letter=&lt;name&gt;<br><br>Good luck.<br><br><em class="text-italics">Correction: NFL uses /teams/players/?letter=&lt;name&gt;<br><br>So changing if {$sport == "nfl"} to use tsn.ca/nfl/teams/players/?letter=blah blah blah.. should work, in theory.</em><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6130">incith</a> — Fri Aug 18, 2006 11:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-08-17T15:13:39-04:00</updated>

		<published>2006-08-17T15:13:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65570#p65570</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65570#p65570"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65570#p65570"><![CDATA[
<blockquote class="uncited"><div>Yeah but people who know tcl can't seem to help me, here or in requests, so i'm thinking just my knowing tcl isn't going to help me write a script this elaborate in a couple weeks, altho, i do want to learn.</div></blockquote>That's because, as Demond pointed out, it would require a lot of analysis (mostly for the webpages that it's trying to grab). Which isn't necessarily difficult, it's just not a project people have shown an interest in. Since you are interested in this script, take it over and fix it and release a new version. I've done that with several very complex scripts. <br><br>It's a good way to learn tcl <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Aug 17, 2006 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-08-17T12:25:19-04:00</updated>

		<published>2006-08-17T12:25:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65568#p65568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65568#p65568"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65568#p65568"><![CDATA[
...or offer a small fee; if you can spend like 10-15 bucks for that, I guess some of our younger friends here would be willing to take on it (I myself am not interested)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Aug 17, 2006 12:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cletus]]></name></author>
		<updated>2006-08-17T11:36:19-04:00</updated>

		<published>2006-08-17T11:36:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65564#p65564</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65564#p65564"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65564#p65564"><![CDATA[
Yeah but people who know tcl can't seem to help me, here or in requests, so i'm thinking just my knowing tcl isn't going to help me write a script this elaborate in a couple weeks, altho, i do want to learn.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8062">Cletus</a> — Thu Aug 17, 2006 11:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-08-16T22:52:19-04:00</updated>

		<published>2006-08-16T22:52:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65551#p65551</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65551#p65551"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65551#p65551"><![CDATA[
Or do what I did.. Learn tcl =) <br>Only took a coupla weeks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed Aug 16, 2006 10:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cletus]]></name></author>
		<updated>2006-08-16T20:32:03-04:00</updated>

		<published>2006-08-16T20:32:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65548#p65548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65548#p65548"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65548#p65548"><![CDATA[
OK, I do use rss news feeds but they will never be able to do what this script does.  Too bad nobody will be able to help, I didn't realize it was gonna be that complicated of a process, but I don't know crap about writing these things either.  I guess I'll just continue to search for the author.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8062">Cletus</a> — Wed Aug 16, 2006 8:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-08-15T23:25:49-04:00</updated>

		<published>2006-08-15T23:25:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65515#p65515</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65515#p65515"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65515#p65515"><![CDATA[
all scripts that fetch info from webpages eventually get broken as those pages change in structure and authors are no longer around to update their hardcoded stuff; that is your case as well<br><br>you won't get the help you need - why? because in order to update this script, someone would have to bother to: 1. study the script's logic 2. study the html structure of changed webpage and 3. come up with a patch that would handle the new structure - efforts that most if not all people here won't be willing to make<br><br>hint: ditch this thing, find RSS feed serving your needs, use RSS news script<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Aug 15, 2006 11:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cletus]]></name></author>
		<updated>2006-08-15T23:05:02-04:00</updated>

		<published>2006-08-15T23:05:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65514#p65514</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65514#p65514"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65514#p65514"><![CDATA[
I'm sorry I don't know what that means, or how to give that info, can you help me further maybe?<br><br>I can say that the partyline gives me no error info, from simply idling on it while trying to use the broken part of the script.<br><br>Here's an example of what I type in channel and the response I get:<br><br>(21:56:29) (~Cletus) .nflscout randy moss<br>(21:56:32) (&amp;OJ) Couldn't find Moss, Randy in the database.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8062">Cletus</a> — Tue Aug 15, 2006 11:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-08-15T18:39:07-04:00</updated>

		<published>2006-08-15T18:39:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65503#p65503</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65503#p65503"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65503#p65503"><![CDATA[
Post the results of '.set errorInfo'.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Tue Aug 15, 2006 6:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cletus]]></name></author>
		<updated>2006-08-18T15:00:37-04:00</updated>

		<published>2006-08-15T15:36:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65493#p65493</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65493#p65493"/>
		<title type="html"><![CDATA[football links are broke with tsnstats 0.6 [Problem Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65493#p65493"><![CDATA[
I think the link is broke for football and golf, those are the only links broke though, can someone help me with this, I looked on efnet for AkiraX but he wasn't there.  I got the script from these archives.  thanks.<br><div class="codebox"><p>Code: </p><pre><code>##############################################  tsnstats.tcl v0.6       by AkiraX        ##                    &lt;#AnimeFiends@EFNet&gt;   ##################################################### DESCRIPTION ########################## looks up player stats and info for# professional sports leagues from tsn.ca#################################################### USAGE ################################# [league] can be: !nhl !nfl !mlb !nba !pga## ![league] &lt;name&gt; ................... personal player info# ![league]stats [year] &lt;name&gt; ....... player stats and injury/roster status# ![league]playoffs [year] &lt;name&gt; .... playoff stats# ![league]history [year] &lt;name&gt; ..... player transactions and awards# ![league]history &lt;name&gt; "search" ... transactions and awards matching "search"# ![league]scout &lt;name&gt; .............. scouting report# ![league]photo &lt;name&gt; .............. player profile photo## &lt;name&gt; can be "firstname lastname" or "lastname, firstname"## [year] is optional, and can be "20XX" or "XX" or "XX-YY"##################################################### NOTES ################################ Limited results for playoffs in all sports# (NHL and NBA seem to be the only good ones)#################################################### LICENSE ############################# # This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.# # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, U#############################################package require httpbind pub -|- !nhl tsn:nhlproc tsn:nhl { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl core}bind pub -|- !nhlstats tsn:nhlstatsproc tsn:nhlstats { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl stats}bind pub -|- !nhlplayoffs tsn:nhlplayoffsproc tsn:nhlplayoffs { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl playoffs}bind pub -|- !nhlhistory tsn:nhlhistoryproc tsn:nhlhistory { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl history}bind pub -|- !nhlscout tsn:nhlscoutproc tsn:nhlscout { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl scout}bind pub -|- !nhlphoto tsn:nhlphotoproc tsn:nhlphoto { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nhl photo}bind pub -|- !nfl tsn:nflproc tsn:nfl { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl core}bind pub -|- !nflstats tsn:nflstatsproc tsn:nflstats { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl stats}bind pub -|- !nflplayoffs tsn:nflplayoffsproc tsn:nflplayoffs { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl playoffs}bind pub -|- !nflhistory tsn:nflhistoryproc tsn:nflhistory { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl history}bind pub -|- !nflscout tsn:nflscoutproc tsn:nflscout { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl scout}bind pub -|- !nflphoto tsn:nflphotoproc tsn:nflphoto { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nfl photo}bind pub -|- !mlb tsn:mlbproc tsn:mlb { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb core}bind pub -|- !mlbstats tsn:mlbstatsproc tsn:mlbstats { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb stats}bind pub -|- !mlbplayoffs tsn:mlbplayoffsproc tsn:mlbplayoffs { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb playoffs}bind pub -|- !mlbhistory tsn:mlbhistoryproc tsn:mlbhistory { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb history}bind pub -|- !mlbscout tsn:mlbscoutproc tsn:mlbscout { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb scout}bind pub -|- !mlbphoto tsn:mlbphotoproc tsn:mlbphoto { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name mlb photo}bind pub -|- !nba tsn:nbaproc tsn:nba { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba core}bind pub -|- !nbastats tsn:nbastatsproc tsn:nbastats { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba stats}bind pub -|- !nbaplayoffs tsn:nbaplayoffsproc tsn:nbaplayoffs { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba playoffs}bind pub -|- !nbahistory tsn:nbahistoryproc tsn:nbahistory { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba history}bind pub -|- !nbascout tsn:nbascoutproc tsn:nbascout { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba scout}bind pub -|- !nbaphoto tsn:nbaphotoproc tsn:nbaphoto { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name nba photo}bind pub -|- !pga tsn:pgaproc tsn:pga { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga core}bind pub -|- !pgastats tsn:pgastatsproc tsn:pgastats { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga stats}bind pub -|- !pgaplayoffs tsn:pgaplayoffsproc tsn:pgaplayoffs { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga playoffs}bind pub -|- !pgahistory tsn:pgahistoryproc tsn:pgahistory { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga history}bind pub -|- !pgascout tsn:pgascoutproc tsn:pgascout { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga scout}bind pub -|- !pgaphoto tsn:pgaphotoproc tsn:pgaphoto { nick host handle chan text } {set name [join [lrange [split $text] 0 end]]tsn:run $chan $name pga photo}proc tsn:run { chan name sport type } {# format the inputset year 0set namecount 0set namecheck ""foreach entry [split $name] {set entry [string map { {-} {} } $entry]if { [string is integer -strict $entry] } {set year [join [lindex [split $name] $namecount]]} {set namecheck "$namecheck [join [lindex [split $name] $namecount]]"}incr namecount}if { $namecheck != "" } {set name $namecheck}if { $name == "" } {if { ($type == "stats") || ($type == "playoffs") || ($type == "history") } {if { $year == 0 } {puthelp "PRIVMSG $chan :You must provide a last name: !$sport$type \[year\] lastname, firstname"} {puthelp "PRIVMSG $chan :You must provide a last name: !$sport$type $year lastname, firstname"}} {puthelp "PRIVMSG $chan :You must provide a last name: !$sport$type lastname, firstname"}return}# format the yearset input(year) $yearset input(yearalt) "$year-"if { $year == 0 } {if { ($type == "playoffs") || ($type == "history") } {set input(year) "2006"set input(yearalt) "05-06"}} {if { [string first "-" $year] &lt; 0 } {if { [string length $year] == 4 } {set input(yearalt) "[string range $year 2 3]"}}}# format the nameset name [string trim $name]if { ([regexp {\,} $name]) || ([regexp { } $name]) } {if { [regexp {\,} $name] } {set input(lastname) [join [lindex [split $name {,}] 0]]set input(firstname) [join [lindex [split $name {,}] 1]]} {if { [regexp { } $name] } {set input(firstname) [string totitle [join [lindex [split $name] 0]]]set input(lastname) [string totitle [join [lrange [split $name] 1 end]]]}}set input(name) "[string totitle [string trim $input(lastname)]], [string totitle [string trim $input(firstname)]]"} {set input(name) [string totitle $name]}# find the player pageset token [http::config -useragent "Mozilla"]set input(lookupurl) "http://www.tsn.ca/$sport/teams/players/?letter=[string index $input(name) 0]"if { $sport == "nfl" } { set input(lookupurl) "http://www.tsn.ca/nfl/player_list.asp?letter=[string index $input(name) 0]" }if { $sport == "pga" } { set input(lookupurl) "http://www.tsn.ca/golf/player_list.asp?letter=[string index $input(name) 0]" }set token [http::geturl $input(lookupurl) -timeout 15000]upvar #0 $token stateif { $state(status) == "timeout" } {puthelp "PRIVMSG $chan :Sorry, your request timed out."return}set input(html) [split [http::data $token] "\n"]http::cleanup $token# find the player urlset input(url) ""set input(namelist) ""foreach line $input(html) {if { [regexp {/players?.bio} $line] } {if { [string match -nocase *$input(name)* "$line"]} {# perfect matchif { [regexp {\,} $input(name)] } {regexp {&lt;a href\=\"(.*?)\"} $line match input(url)break}# collect $name* matchesset first ""set last ""if { ($sport == "nfl") || ($sport == "pga") } {regexp {&gt;(.*?)\,} [string range $line [string last "\"" $line] end] match lastname} {regexp {hubname=.*?\"&gt;(.*?)\,} $line match lastname}regexp {\,(.*?)&lt;} $line match firstnameif { ([string match -nocase $input(name)* "$lastname"]) || ([string compare -nocase "$input(name)" "$lastname"] == 0) } {regexp {&lt;a href\=\"(.*?)\"} $line match input(url)lappend input(namelist) "[string trim $firstname] [string trim $lastname]"continue}}}}if { $input(url) == "" } {puthelp "PRIVMSG $chan :Couldn't find \002$input(name)\002 in the database."return}if { [llength $input(namelist)] &gt; 1 } {set output "Found [llength $input(namelist)] matches: [lindex $input(namelist) 0]"foreach name [lrange $input(namelist) 1 end] {set output "$output, $name"}puthelp "PRIVMSG $chan :$output"return}# grab the player pageset token [http::geturl "http://www.tsn.ca$input(url)" -timeout 15000]upvar #0 $token stateif { $state(status) == "timeout" } {puthelp "PRIVMSG $chan :Sorry, your request timed out."return}set input(html) [split [http::data $token] "\n"]http::cleanup $token## get player statsset player(name) ""set player(team) ""set player(city) ""set player(number) ""set player(position) ""set player(photo) ""set player(age) ""set player(birthday) ""set player(birthplace) ""set player(hometown) ""set player(college) ""set player(height) ""set player(weight) ""set player(hand) ""set player(handbat) ""set player(exp) ""set player(draft) ""set player(signed) ""set scout(grab) 0set scout(assets) ""set scout(flaws) ""set scout(potential) ""set stats(grab) 0set stats(status) ""set stats(columns) ""set stats(data) ""set stats(next) ""set history(grab) 0set history(data) ""set playoffs(grab) 0set playoffs(columns) ""set playoffs(data) ""set playoffs(next) ""foreach line $input(html) {# teamif { [regexp {szone} $line] } {regexp {szone\=\"...\-(.*?)\"} $line match player(team)set player(team) [string trim [string totitle $player(team)]]set player(team) [string map { {_} {} } $player(team)]continue}# cityif { ($player(city) == "") &amp;&amp; ([regexp {&lt;td class\=\'pad10\'&gt;} $line]) } {if { $sport == "mlb" } { regexp {&lt;b&gt;(.*?) } $line match player(city) }if { $player(city) == "" } { regexp {&lt;b&gt;(.*?)&lt;/b&gt;} $line match player(city) }if { $player(city) == "" } { set player(city) " " }if { $type == "photo" } { break }continue}# name, number and positionif { [regexp {class\=\'playername\'} $line] } {regexp {\'playername\'&gt;(.*?)&lt;} $line match player(name)set player(name) [string trim [string map { { } {} } $player(name)]]regexp {\'playerposition\'&gt;(.*?)&lt;} $line match numposset numpos [string trim [string map { { } {} } $numpos]]set player(number) [join [lindex [split $numpos] 0]]set player(position) [join [lindex [split $numpos] 1]]continue}# imageif { $type == "photo" } {if { [regexp {pics.forecaster.ca} $line] } {set player(photo) ""regexp {&lt;img src=\'(.*?)\'} $line match player(photo)continue}}# player core infoif { $type == "core" } {if { [regexp {Current Status} $line] } { break }if { [regexp {&lt;b&gt;DOB:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(birthday); continue }if { [regexp {&lt;b&gt;Age:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(age); continue }if { [regexp {&lt;b&gt;Place of Birth:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(birthplace); continue }if { [regexp {&lt;b&gt;Hometown:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(hometown); continue }if { [regexp {&lt;b&gt;College:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(college); continue }if { [regexp {&lt;b&gt;HT:&lt;/b&gt;} $line] } {regexp {HT:&lt;/b&gt; ?(.*?) ?&lt;b&gt;} $line match player(height)regexp {WT:&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(weight)continue}if { [regexp {&lt;b&gt;Shoots: ?&lt;/b&gt;} $line] } {regexp {&lt;/b&gt;(.*?)&lt;/td&gt;} $line match player(hand)if { $player(hand) == "L" } { set player(hand) "left" }if { $player(hand) == "R" } { set player(hand) "right" }continue}if { [regexp {&lt;b&gt;Bats/Throws: ?&lt;/b&gt;} $line] } {regexp {&lt;/b&gt;(.*?)&lt;/td&gt;} $line match handset player(hand) [join [lindex [split $hand {/}] 1]]set player(handbat) [join [lindex [split $hand {/}] 0]]if { $player(hand) == "L" } { set player(hand) "lefty" }if { $player(hand) == "R" } { set player(hand) "righty" }if { $player(hand) == "S" } { set player(hand) "switch" }if { $player(handbat) == "L" } { set player(handbat) "lefty" }if { $player(handbat) == "R" } { set player(handbat) "righty" }if { $player(handbat) == "S" } { set player(handbat) "switch" }continue}if { [regexp {&lt;b&gt;... Seasons: ?&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(exp); continue }if { [regexp {Drafted by} $line] } { regexp {\'pad10\'&gt;(.*?)\.?&lt;/td&gt;} $line match player(draft); continue }if { [regexp {Signed by} $line] } { regexp {\'pad10\'&gt;(.*?)\.?&lt;/td&gt;} $line match player(signed); continue }}# player season stats and historyif { ($type == "stats") || ($type == "playoffs") || ($type == "history") } {if { [regexp {Current Status\:} $line] } {regexp {Current Status\: ?(.*?)&lt;/td&gt;} $line match stats(status)set stats(grab) 1continue}if { $stats(grab) &gt; 0 } {if { [regexp {Playoff Stats} $line] } {set playoffs(grab) 1set stats(grab) 2continue}if { $stats(grab) == 1 } {if { $input(year) == 0 } {if { [regexp {&lt;/tr&gt;} $line] } {set stats(grab) 3}} {if { [regexp {Career Stats} $line] } {set stats(grab) 2} {if { [regexp {Scouting Report} $line] } {set history(grab) 1continue}# find transactions, injuries, etcif { $history(grab) &gt; 0 } {if { [regexp {row.?\'&gt;} $line] } {set entry ""regexp {row.?\'&gt;(.*?)&lt;/td&gt;} $line match entry# event yearif { $history(grab) == 1 } {if { [tsn:checkyear $input(year) $input(yearalt) $entry] } {set history(data) "$history(data) $entry"if { [string index $history(data) end] != ":" } {set history(data) "$history(data):"}set history(grab) 2continue}}# event descriptionif { $history(grab) == 2 } {if { [string index $entry end] != "." } {set entry "$entry."}set history(data) "$history(data) $entry"set history(grab) 1}}}}}continue} {if { [regexp {&lt;/tr&gt;} $line] } {incr stats(grab)if { $stats(grab) &gt; 4 } {if { $input(year) == 0 } { break }if { $stats(grab) == 5 } {set stats(grab) 6if { $playoffs(grab) } {if { [tsn:checkyear $input(year) $input(yearalt) [lindex $playoffs(data) 0]] == 0 } {set stats(grab) 4set playoffs(data) ""}} {if { [tsn:checkyear $input(year) $input(yearalt) [lindex $stats(data) 0]] == 0 } {set stats(grab) 4set stats(data) ""}}continue}if { $stats(grab) &gt; 5 } {if { $playoffs(grab) } {if { [llength $playoffs(next)] &lt;= 0 } { break }if { [tsn:checkyear $input(year) $input(yearalt) [lindex $playoffs(next) 0]] == 0 } { break }if { [string first "Total" "[lindex $playoffs(next) 1]"] &gt;= 0 } { break }foreach entry $playoffs(next) {lappend playoffs(data) "$entry"}set stats(grab) 6set playoffs(next) ""} {if { [llength $stats(next)] &lt;= 0 } { set stats(grab) 1; continue }if { [tsn:checkyear $input(year) $input(yearalt) [lindex $stats(next) 0]] == 0 } { set stats(grab) 1; continue }if { [string first "Total" "[lindex $stats(next) 1]"] &gt;= 0 } { set stats(grab) 1; continue }foreach entry $stats(next) {lappend stats(data) "$entry"}set stats(grab) 6set stats(next) ""}}}continue}if { [regexp {row.?\'&gt;} $line] } {set entry ""regexp {row.?\'&gt;(.*?)&lt;/td&gt;} $line match entryif { $entry != "" } {if { $playoffs(grab) } {switch $stats(grab) \3 { lappend playoffs(columns) "$entry" } \4 { lappend playoffs(data) "$entry" } \6 {lappend playoffs(next) "$entry" }} {switch $stats(grab) \3 { lappend stats(columns) "$entry" } \4 { lappend stats(data) "$entry" } \6 {lappend stats(next) "$entry" }}}continue}}}}# player scouting infoif { $type == "scout" } {if { [regexp {Honours and Awards} $line] } { break }if { [regexp {&lt;b&gt;Age:&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(age) }if { [regexp {&lt;b&gt;HT:&lt;/b&gt;} $line] } {regexp {HT:&lt;/b&gt; ?(.*?) &lt;b&gt;} $line match player(height)regexp {WT:&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(weight)}if { [regexp {&lt;b&gt;... Seasons: ?&lt;/b&gt;} $line] } { regexp {&lt;/b&gt; ?(.*?)&lt;/td&gt;} $line match player(exp) }if { [regexp {Assets} $line] } { set scout(grab) 1; continue }if { [regexp {Flaws} $line] } { set scout(grab) 2; continue }if { [regexp {Career potential} $line] } { set scout(grab) 3; continue }if { $scout(grab) == 1 } { regexp {&gt;(.*?)&lt;/td&gt;} $line match scout(assets); set scout(grab) 0 }if { $scout(grab) == 2 } { regexp {&gt;(.*?)&lt;/td&gt;} $line match scout(flaws); set scout(grab) 0 }if { $scout(grab) == 3 } { regexp {&gt;(.*?)&lt;/td&gt;} $line match scout(potential); set scout(grab) 0 }}}# create final outputset output ""if { [string index $player(number) end] != "-" } {if { (($input(year) == 0) || ($type == "history") || ($type == "photo")) &amp;&amp; ($player(city) != "") &amp;&amp; ($player(team) != "") } {set output "$player(city) $player(team) \002$player(number) $player(name)\002"} {set output "\002$player(number) $player(name)\002"}} {if { (($input(year) == 0) || ($type == "history") || ($type == "photo")) &amp;&amp; ($player(city) != "") &amp;&amp; ($player(team) != "") } {set output "$player(city) $player(team) \002$player(name)\002"} {set output "\002$player(name)\002"}}if { $type == "photo" } {if { $player(photo) == "" } {puthelp "PRIVMSG $chan :No profile photo found for \002$player(name)\002."return}puthelp "PRIVMSG $chan :$output Profile photo: $player(photo)"return}if { $type == "core" } {set output "$output \[$player(height) $player(weight)lbs\]"if { $player(age) != "" } { set output "$output $player(age)yo" }if { ($player(hand) != "") &amp;&amp; ($sport != "mlb") } { set output "$output $player(hand)-handed" }if { $player(position) != "" } { set output "$output $player(position)" }if { $player(hometown) != "" } { set output "$output from $player(hometown)" }set output "$output."if { ($player(hand) != "") &amp;&amp; ($sport == "mlb") } {set output "$output Throws $player(hand), bats $player(handbat)."}if { ($player(birthday) != "") &amp;&amp; ($player(birthplace) != "") } {set output "$output Born $player(birthday) in $player(birthplace)."}if { $player(draft) != "" } {set output "$output $player(draft)"if { $player(college) != "" } { set output "$output out of $player(college)" }set output "$output."}if { $player(signed) != "" } { set output "$output $player(signed)." }if { $player(exp) != "" } { set output "$output Has played $player(exp) seasons." }puthelp "PRIVMSG $chan :[string trim $output]"return}if { $type == "history" } {if { $history(data) == "" } {set output "No injuries, transactions or awards found for \002$player(name)\002 in $input(year)."} {if { $stats(status) != "" } {set output "$output \[Status: $stats(status)\]"}set output "$output $history(data)"}puthelp "PRIVMSG $chan :$output"return}if { ($type == "stats") || ($type == "playoffs") } {if { $type == "stats" } {if { ([llength $stats(columns)] &lt;= 0) || ([llength $stats(data)] &lt;= 0) } {if { $input(year) == 0 } {set output "No current season stats were found for \002$input(name)\002."} {set output "No season $input(year) stats were found for \002$input(name)\002."}puthelp "PRIVMSG $chan :$output"return}} {if { ([llength $playoffs(columns)] &lt;= 0) || ([llength $playoffs(data)] &lt;= 0) } {set output "No $input(year) playoff stats were found for \002$input(name)\002."puthelp "PRIVMSG $chan :$output"return}}if { $input(year) == 0 } {set output "$output Status($stats(status))"} {set output ""if { [string index $player(number) end] != "-" } {set output "$player(number) $player(name)"} {set output "$player(name)"}}set col 0set row 0set outrun 0while { $outrun != 2 } {set runtype $typeif { $outrun == 1 } {set col 0set row 0set runtype "playoffs"}if { $runtype == "stats" } {set out(columns) $stats(columns)set out(data) $stats(data)set outrun 1} {if { ($playoffs(columns) == "") || ($playoffs(data) == "") } {break}set out(columns) $playoffs(columns)set out(data) $playoffs(data)set outrun 2}foreach entry $stats(data) {incr colincr rowif { $input(year) == 0 } {if { $col == 1 } {if { ($runtype == "playoffs") } {set output "$output \[Playoffs [lindex $out(data) 1]\] [lindex $out(data) 0]"} {set output "$output \[[lindex $out(data) 1]\] [lindex $out(data) 0]"}} {if { $col &lt; [llength $out(columns)] } {set output "$output [lindex $out(columns) $col]([lindex $out(data) $row])"}}continue} {if { $col == 1 } {if { $sport == "nfl" } {set output "$output \002\[[lindex $out(data) [expr { $row-1 }]] [lindex $out(data) $row]\]\002"incr colincr row} {if { $runtype == "playoffs" } {set output "$output \002\[Playoffs [lindex $out(data) [expr { $row-1 }]] ([lindex $out(data) [expr { $row+1 }]]) [lindex $out(data) $row]\]\002"} {set output "$output \002\[[lindex $out(data) [expr { $row-1 }]] ([lindex $out(data) [expr { $row+1 }]]) [lindex $out(data) $row]\]\002"}incr col 2incr row 2}}if { ($col &lt; [llength $out(columns)]) &amp;&amp; ($row &lt; [llength $out(data)]) } {set output "$output [lindex $out(columns) $col]([lindex $out(data) $row])"} {if { $input(year) == 0 } { break }if { $row &gt;= [expr { [llength $out(data)] }] } { break }set col 0}}}}if { ($type != "playoffs") &amp;&amp; ($history(data) != "") } {set output "$output $history(data)"}puthelp "PRIVMSG $chan :[string trim $output]"return}if { $type == "scout" } {if { ($scout(assets) == "") &amp;&amp; ($scout(flaws) == "") &amp;&amp; ($scout(potential) == "") } {puthelp "PRIVMSG $chan :Sorry, no scouting report for \002$player(name)\002 is available."return}set output "$output \[$player(height) $player(weight)lbs"if { $player(age) != "" } { set output "$output $player(age)yo" }if { $player(exp) != "" } { set output "$output $player(exp)-seasons" }set output "$output\] Scouting report:"if { $scout(potential) != "" } { set output "$output $scout(potential)" }puthelp "PRIVMSG $chan :$output"if { $scout(assets) != "" } { puthelp "PRIVMSG $chan :Assets: $scout(assets)" }if { $scout(flaws) != "" } { puthelp "PRIVMSG $chan :Flaws: $scout(flaws)" }return}puthelp "PRIVMSG $chan :[string trim $output]"return}proc tsn:checkyear { year yearalt input } {if { ([string compare "$year" "$input"] != 0) &amp;&amp; ([string first "$yearalt" "$input"] &lt; 0) } {if { [string index $input end] == ":" } {if { [string length $year] == 2 } {if { [string compare $year [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }}if { [string length $year] == 4 } {if { [string compare [string range $year 2 3] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }}if { [string length $year] == 5 } {if { [string compare [string range $year 0 1] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }#if { [string compare [string range $year 3 4] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }}if { [string length $year] == 7 } {if { [string compare [string range $year 2 3] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }if { [string compare [string range $year 5 6] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }}if { ([string length $yearalt] == 5) &amp;&amp; ([string index $yearalt 2] == "-") } {if { [string compare [string range $yearalt 0 1] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }if { [string compare [string range $yearalt 3 4] [string range $input [expr { [string length $input]-3 }] end-1]] == 0 } { return 1 }}} {if { [string length $input] == 4 } {if { ([string length $yearalt] == 5) &amp;&amp; ([string index $yearalt 2] == "-") } {if { [string compare [string range $yearalt 0 1] [string range $input [expr { [string length $input]-2 }] end]] == 0 } { return 1 }if { [string compare [string range $yearalt 3 4] [string range $input [expr { [string length $input]-2 }] end]] == 0 } { return 1 }}}}return 0}return 1}putlog "tsnstats.tcl v0.6 by AkiraX &lt;#AnimeFiends@EFnet&gt; loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8062">Cletus</a> — Tue Aug 15, 2006 3:36 pm</p><hr />
]]></content>
	</entry>
	</feed>
