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

	<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-11-07T16:41:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-07T16:41:22-04:00</updated>

		<published>2009-11-07T16:41:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90841#p90841</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90841#p90841"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90841#p90841"><![CDATA[
Ah, I used '"<a href="http://mysite.com/spotInfo.php" class="postlink">http://mysite.com/spotInfo.php</a>" "uri" $track' and putquick. I tried '"<a href="http://mysite.com/spotInfo.php" class="postlink">http://mysite.com/spotInfo.php</a>" "uri" $track' a lot of times before you wrote it, but it didn't return any message or errors.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Sat Nov 07, 2009 4:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-07T16:37:52-04:00</updated>

		<published>2009-11-07T16:37:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90840#p90840</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90840#p90840"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90840#p90840"><![CDATA[
Ehhm?<br>puthelp vs putquick should'nt matter, most certainly not cause an error like that. Happy you got it sorted in the end though...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Nov 07, 2009 4:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-07T16:22:15-04:00</updated>

		<published>2009-11-07T16:22:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90839#p90839</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90839#p90839"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90839#p90839"><![CDATA[
Yeah, I tried hundreds of ways, but it turned out that it was the puthelp line (I replaced it with  putquick "PRIVMSG $chan :$line").<br><br>Thanks for your help! <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=10344">JKM</a> — Sat Nov 07, 2009 4:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-07T15:52:52-04:00</updated>

		<published>2009-11-07T15:52:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90838#p90838</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90838#p90838"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90838#p90838"><![CDATA[
That error originates from the http-package... Most likely due to the second ? in the URI...<br>Try using this instead then:<div class="codebox"><p>Code: </p><pre><code>set data_lines [grap_http_data 2 "http://mysite.com/spotInfo.php" "uri" $track]</code></pre></div>That should build the url <a href="http://mysite.com/spotify.php?uri=4SwVcoBjjawbnexIiUDLc5" class="postlink">http://mysite.com/spotify.php?uri=4SwVc ... nexIiUDLc5</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Nov 07, 2009 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-07T15:12:33-04:00</updated>

		<published>2009-11-07T15:12:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90834#p90834</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90834#p90834"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90834#p90834"><![CDATA[
Oh, sorry about that.<div class="codebox"><p>Code: </p><pre><code>set data_lines [grab_http_data 2  http://mysite.com/spotInfo.php?uri=${track} "" ""]</code></pre></div>returns:<br><br>[20:10] Tcl error [SpotInfo_proc]: Unsupported URL: <a href="http://mysite.com/spotify.php?uri=4SwVcoBjjawbnexIiUDLc5?=" class="postlink">http://mysite.com/spotify.php?uri=4SwVc ... xIiUDLc5?=</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Sat Nov 07, 2009 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-06T16:36:12-04:00</updated>

		<published>2009-11-06T16:36:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90820#p90820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90820#p90820"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90820#p90820"><![CDATA[
Well, I just copied and pasted that code, and it works just fine. Check that there's no accidental newlines in the pasted code...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 06, 2009 4:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-06T11:18:14-04:00</updated>

		<published>2009-11-06T11:18:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90816#p90816</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90816#p90816"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90816#p90816"><![CDATA[
It seems to be an error in the regex line - I just copied that line from your code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Fri Nov 06, 2009 11:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-06T08:37:38-04:00</updated>

		<published>2009-11-06T08:37:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90815#p90815</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90815#p90815"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90815#p90815"><![CDATA[
Then, most likely, you've made a typo while writing the new code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 06, 2009 8:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-06T08:08:37-04:00</updated>

		<published>2009-11-06T08:08:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90813#p90813</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90813#p90813"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90813#p90813"><![CDATA[
Anyone? <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=10344">JKM</a> — Fri Nov 06, 2009 8:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-04T16:32:50-04:00</updated>

		<published>2009-11-04T16:32:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90800#p90800</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90800#p90800"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90800#p90800"><![CDATA[
[SpotInfo_proc]: wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"<br><br>Edit: This error comes every time someone writes something.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Wed Nov 04, 2009 4:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-04T14:36:38-04:00</updated>

		<published>2009-11-04T14:36:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90799#p90799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90799#p90799"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90799#p90799"><![CDATA[
Think I concatenated the url and query parameters into one, but I see you managed to adapt your grab_http_data proc to compensate.<br><br>Looking at the whole script, what you do is fetch the content of the <a href="http://mysite.com/" class="postlink">http://mysite.com/</a>... URI, and store this in the local variable data_lines in SpotInfo_proc. However, you do not do anything else with it, and the data is lost once the proc ends.<br><br>If you'd like to output this into the channel, you'll most likely need to use puthelp along with the appropriate irc command, ie:<div class="codebox"><p>Code: </p><pre><code>proc SpotInfo_proc {nick uhost hand chan arg} {  if {[regexp -nocase -- {(?:http://open\.spotify\.com/track/|spotify:track:)([[:alnum:]]{22})} $arg spotify track]} {    set data_lines [grab_http_data 2 http://mysite.com/spotInfo.php?uri=${track}]    if {![string equal $data_lines "error"]} {      foreach line [split $data_lines "\n"] {        puthelp "NOTICE $chan :$line"      }    }  }}</code></pre></div>You'll probably have to adjust the code to suit the actual output from the http-request, as I have no idea of the actual content.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Nov 04, 2009 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-03T23:27:35-04:00</updated>

		<published>2009-11-03T23:27:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90785#p90785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90785#p90785"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90785#p90785"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pubm -|- * SpotInfo_procpackage require httpproc SpotInfo_proc {nick uhost hand chan arg} {  if {[regexp -nocase -- {(?:http://open\.spotify\.com/track/|spotify:track:)([[:alnum:]]{22})} $arg spotify track]} {    set data_lines [grab_http_data 2 http://mysite.com/spotInfo.php?uri=${track}]  }}proc grab_http_data { type url } {   set user_agent "http-query.tcl &lt;eggdrop script&gt;"   set tiny_token [http::config -useragent $user_agent]   if {$type == 1} {      set tiny_token [http::geturl $url -timeout 10000]   } else {      set proper_url "$url"      set tiny_token [http::geturl $proper_url -timeout 10000]   }   set html_data [http::data $tiny_token]   if {$html_data != ""} {      return $html_data   } {      return "error"   }}putlog "SpotInfo.tcl loaded"</code></pre></div>It doesn't return any errors or anything. First it said:<blockquote class="uncited"><div>[04:43] Tcl error [SpotInfo_proc]: wrong # args: should be "grab_http_data type url query arg"</div></blockquote>And then<blockquote class="uncited"><div>[04:49] Tcl error [SpotInfo_proc]: can't read "query": no such variable</div></blockquote>But then I fixed the grab_http_data, but now it doesn't say anything.<br><br>Thanks for the help so far!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Tue Nov 03, 2009 11:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-03T15:23:20-04:00</updated>

		<published>2009-11-03T15:23:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90784#p90784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90784#p90784"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90784#p90784"><![CDATA[
This should do the trick, it will handle both <a href="http://open.spotify.com/track/" class="postlink">http://open.spotify.com/track/</a> and spotify:track: style uri's, and will be able to catch them in both sentences and "alone".<div class="codebox"><p>Code: </p><pre><code>proc SpotInfo_proc {nick uhost hand chan arg} {  if {[regexp -nocase -- {(?:http://open\.spotify\.com/track/|spotify:track:)([[:alnum:]]{22})} $arg spotify track]} {    set data_lines [grab_http_data 2 http://mysite/check?code=${track}]  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Nov 03, 2009 3:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-11-03T08:22:21-04:00</updated>

		<published>2009-11-03T08:22:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90779#p90779</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90779#p90779"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90779#p90779"><![CDATA[
sorry, dont seem to understand what you mean. what is spotify:track:? and what do you want to be done differently regarding urls?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Tue Nov 03, 2009 8:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2009-11-03T08:12:02-04:00</updated>

		<published>2009-11-03T08:12:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90778#p90778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90778#p90778"/>
		<title type="html"><![CDATA[Find part of a word/url]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90778#p90778"><![CDATA[
I gave you some examples for the url, I want to fetch the code/hash from any spotify urls and uris<br><a href="http://open.spotify.com/track/" class="postlink">http://open.spotify.com/track/</a>*<br>spotify:track:*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Tue Nov 03, 2009 8:12 am</p><hr />
]]></content>
	</entry>
	</feed>
