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

	<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-22T03:21:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Elfriede]]></name></author>
		<updated>2010-05-22T03:21:21-04:00</updated>

		<published>2010-05-22T03:21:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93146#p93146</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93146#p93146"/>
		<title type="html"><![CDATA[Parse url from web content]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93146#p93146"><![CDATA[
Many thanks!!! Now its working, like ive wanted it <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=9204">Elfriede</a> — Sat May 22, 2010 3:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-05-21T17:04:28-04:00</updated>

		<published>2010-05-21T17:04:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93145#p93145</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93145#p93145"/>
		<title type="html"><![CDATA[Parse url from web content]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93145#p93145"><![CDATA[
If you want the full line matching the url, please use $match instead of $url in your sendmsg command.<br><br>To stop further processing within the foreach-loop, use the break command just after the sendmsg command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri May 21, 2010 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Elfriede]]></name></author>
		<updated>2010-05-21T15:45:33-04:00</updated>

		<published>2010-05-21T15:45:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93143#p93143</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93143#p93143"/>
		<title type="html"><![CDATA[Parse url from web content]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93143#p93143"><![CDATA[
Many thanks for ur answer, but the output looks atm like:<br><br>Data: ://imdb.de/title/...          Û<br><br>The http is cutted and theres a space after the url, where the output should end - can u please add that ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>PS: how to stop eg on first match ? ^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9204">Elfriede</a> — Fri May 21, 2010 3:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-05-21T14:26:24-04:00</updated>

		<published>2010-05-21T14:26:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93141#p93141</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93141#p93141"/>
		<title type="html"><![CDATA[Parse url from web content]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93141#p93141"><![CDATA[
Try using the greedy quantifier * instead of the non-greedy *?<br>Also, the output is most likely not a list, so don't use join. Similarly, $text is a string, not a list, so use split before attempting to use lindex:<br>Next, use $line, not $content in your regular expression, otherwize the foreach loop would be pretty pointless...<div class="codebox"><p>Code: </p><pre><code>bind pub - !geturl geturl:procproc geturl:proc {nick host handle channel text} {   set url [lindex [split $text] 0]   set token [::http::geturl $url]   set content [::http::data $token]   ::http::cleanup $content   foreach line [split $content \n] {      if {[regexp -nocase {http(.*)} $line match url]} {         sendmsg #test "Data: $url"      }   }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri May 21, 2010 2:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Elfriede]]></name></author>
		<updated>2010-05-21T07:35:55-04:00</updated>

		<published>2010-05-21T07:35:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93137#p93137</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93137#p93137"/>
		<title type="html"><![CDATA[Parse url from web content]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93137#p93137"><![CDATA[
Hopefully someone can tell me whats wrong on that. Im going to parse a url out of a webpage, but all i got is Data: many times ^^ Ive searched alot on this Forum, but im not getting the point, how to parse :/ I just wanna output the first matching url.<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !geturl geturl:procproc geturl:proc {nick host handle channel text} {set url [lindex $text 0]set token [::http::geturl $url]set content [::http::data $token]::http::cleanup $contentforeach line [split $content \n] {if {[regexp -nocase {http(.*?)} $content match url]} {sendmsg #test "Data: [join $url]"}}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9204">Elfriede</a> — Fri May 21, 2010 7:35 am</p><hr />
]]></content>
	</entry>
	</feed>
