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

	<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>2008-04-02T15:23:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2008-04-02T15:23:46-04:00</updated>

		<published>2008-04-02T15:23:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82124#p82124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82124#p82124"/>
		<title type="html"><![CDATA[parsing another website]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82124#p82124"><![CDATA[
though you told him how to use split and join properly, you still didn't fix that nasty lrange.<br><br>Using lrange $var 0 end is the exact same as not doing anything at all.<br><br>In this case, you can just use set title $text because "set title [join [lrange [split $text] 0 end]]" quite simply is the exact same.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Wed Apr 02, 2008 3:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-03-23T23:13:20-04:00</updated>

		<published>2008-03-23T23:13:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82001#p82001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82001#p82001"/>
		<title type="html"><![CDATA[Re: parsing another website]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82001#p82001"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>regexp {&lt;td&gt;&lt;b&gt;"&lt;a href="/wiki/.*?" title="$title"&gt;.*?&lt;/a&gt;"&lt;/b&gt;&lt;/td&gt;(.*?)&lt;/tr&gt;} $data - data</code></pre></div></div></blockquote>This is wrong, will never work within curly braces (substitution does not take place within curly bracings). The type of regexp you desire is known as a dynamic regexp. Look at the wikipedia/wikimedia portion of the unofficial google script, it uses these for #subtag look-ups. To use them correctly first build your regexp into a variable, then use quotes to build the regexp.<br><div class="codebox"><p>Code: </p><pre><code>set dynregex "&lt;td&gt;&lt;b&gt;"&lt;a href="/wiki/.*?" title="$title"&gt;.*?&lt;/a&gt;"&lt;/b&gt;&lt;/td&gt;(.*?)&lt;/tr&gt;"if {![regexp "$dynregex" $data - data]} {  #notfound} {  #found}</code></pre></div>Notice, you MUST escape quotes within other quotes, but within curly braces there is no need.<br><br>also, what is the purpose of this beauty?!<div class="codebox"><p>Code: </p><pre><code>set title [lrange $text 0 end] </code></pre></div> remember, do not confuse lists with strings, or vice versa. When you do unexpected behavior occurs, and you will be constantly fighting this later with code kludges and messy filters to compensate. It's always better to do it correctly to begin with.<div class="codebox"><p>Code: </p><pre><code>set title [join [lrange [split $text] 0 end]]</code></pre></div>Notice the split (to protect special characters mischevious users may try for input), then an lrange on the list split creates, and afterwards a join to turn this list back into a string. Remember, #1 rule of Tcl never confuse a list and a string.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Mar 23, 2008 11:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[theice]]></name></author>
		<updated>2008-03-23T00:48:00-04:00</updated>

		<published>2008-03-23T00:48:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81975#p81975</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81975#p81975"/>
		<title type="html"><![CDATA[parsing another website]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81975#p81975"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set title [lrange $text 0 end]putserv "PRIVMSG $c :$title:" regexp {&lt;td&gt;&lt;b&gt;"&lt;a href="/wiki/.*?" title="$title"&gt;.*?&lt;/a&gt;"&lt;/b&gt;&lt;/td&gt;(.*?)&lt;/tr&gt;} $data - dataregexp {&lt;td&gt;&lt;b&gt;&lt;a href="/wiki/.*?" title="(.+?)"&gt;.*?&lt;/a&gt;&lt;/b&gt;&lt;/td&gt;.*?&lt;td&gt;(.+?)&lt;/td&gt;.*?&lt;td&gt;(.+?)&lt;/td&gt;.*?&lt;td&gt;(.+?)&lt;/td&gt;.*?&lt;td&gt;(.+?)&lt;/td&gt;.*?&lt;td&gt;(.+?)&lt;/td&gt;} $data - artist guitar bass drums vocals bandputserv "PRIVMSG $c :by-$artist , Difficulties: Guitar-$guitar , Bass-$bass , VoX-$vocals , Drums-$drums , Band-$band" http::cleanup $data}</code></pre></div>working partially:<br><br><a href="http://en.wikipedia.org/wiki/List_of_songs_in_Rock_Band" class="postlink">http://en.wikipedia.org/wiki/List_of_songs_in_Rock_Band</a><br><br>trying to grab the information from the site the problem is, its using different types of html coding for each title =[<br><div class="codebox"><p>Code: </p><pre><code>[00:47] &lt;@|ICE|&gt; .song Black Hole Sun[00:47] &lt;+ICEdrop&gt; Black Hole Sun:[00:47] &lt;+ICEdrop&gt; by-Jet (band) , Difficulties: Guitar-Tier 6 , Bass-Tier 6 , VoX-Tier 7 , Drums-Tier 5 , Band-Tier 6</code></pre></div>instead of grabbing the correct $title, it grabs the very first one "Are You Gonna Be My Girl"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9778">theice</a> — Sun Mar 23, 2008 12:48 am</p><hr />
]]></content>
	</entry>
	</feed>
