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

	<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>2007-06-17T19:37:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[jfb392]]></name></author>
		<updated>2007-06-17T16:18:32-04:00</updated>

		<published>2007-06-17T16:18:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73626#p73626</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73626#p73626"/>
		<title type="html"><![CDATA[Problem with edited Google script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73626#p73626"><![CDATA[
Thank you speechles, I was so frustrated.<br>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8771">jfb392</a> — Sun Jun 17, 2007 4:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-06-17T19:37:03-04:00</updated>

		<published>2007-06-17T16:12:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73625#p73625</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73625#p73625"/>
		<title type="html"><![CDATA[Problem with edited Google script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73625#p73625"><![CDATA[
if you want to constrain google's search to a specific site, while still allowing your users the freedom search for any term on that specific site, change the section of your code to match like i've done below.<div class="codebox"><p>Code: </p><pre><code> } else {      set query "http://www.google.com/search?btnI=&amp;q="      for { set index 0 } { $index&lt;[llength $arg] } { incr index } {         set query "$query[lindex $arg $index]"         if {$index&lt;[llength $arg]-1} then {            set query "$query+"         }      }       append query "+site%3Apurevolume.com"      # putserv "PRIVMSG $channel :$query" # debug code?      set token [http::config -useragent $agent]      set token [http::geturl $query] </code></pre></div>After the query line is built normally, you can cleary see i just append "+site:purevolume.com".  (: == %3a when <a href="http://code.google.com/enterprise/documentation/xml_reference.html#appendix_url_escaping" class="postlink">encoding for google querys</a>). This should accomplish your goal. enjoy <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>edit: as a side note, for adding other possible constraints <a href="http://code.google.com/enterprise/documentation/xml_reference.html#request_query_terms" class="postlink"> click here</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jun 17, 2007 4:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jfb392]]></name></author>
		<updated>2007-06-17T14:58:11-04:00</updated>

		<published>2007-06-17T14:58:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73622#p73622</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73622#p73622"/>
		<title type="html"><![CDATA[Problem with edited Google script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73622#p73622"><![CDATA[
Commenting out the query line doesn't seem to work.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br><br>This isn't my script, it's just by anal0uge, I just tried to plug something in.<br>I hardly know any TCL.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> <br>Wouldn't I call ::http::formatquery though?<br>Or is there anyway to take the arg and append the purevolume.com to it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8771">jfb392</a> — Sun Jun 17, 2007 2:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-06-17T14:33:21-04:00</updated>

		<published>2007-06-17T14:33:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73621#p73621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73621#p73621"/>
		<title type="html"><![CDATA[Problem with edited Google script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73621#p73621"><![CDATA[
No, its how query is formatted using the http::get function.  That and how you append more data into the string with set query "$query[lindex $arg $index]"  Comment out that 2nd query line and it should work (assuming you do have the previous set query properly formatted. Your first line is not a proper query format, but it might work as a plain url, without the query option to geturl.. Check the manpage for tcl's http and in particular the section on query..  Plenty of example scripts around here as well.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sun Jun 17, 2007 2:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jfb392]]></name></author>
		<updated>2007-06-17T14:15:19-04:00</updated>

		<published>2007-06-17T14:15:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73619#p73619</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73619#p73619"/>
		<title type="html"><![CDATA[Problem with edited Google script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73619#p73619"><![CDATA[
Using the google-0.2.1 script, I attempted to make a script that finds artists on the music site Purevolume by finding the first result on Google.<br><div class="codebox"><p>Code: </p><pre><code>package require httpbind pub - !pv pub:pvset agent "Mozilla"proc pub:pv { nick uhost handle channel arg } { global agentif {[llength $arg]==0} {putserv "PRIVMSG $channel :Keyword please."} else {set query "http://www.google.com/search?btnI=&amp;q=purevolume&amp;"for { set index 0 } { $index&lt;[llength $arg] } { incr index } {set query "$query[lindex $arg $index]"if {$index&lt;[llength $arg]-1} then {set query "$query+"}}putserv "PRIVMSG $channel :$query"                set token [http::config -useragent $agent]set token [http::geturl $query]puts stderr ""upvar #0 $token stateset max 0foreach {name value} $state(meta) {if {[regexp -nocase ^location$ $name]} {set newurl [string trim $value]putserv "PRIVMSG $channel :$newurl"}}}}</code></pre></div>If I remove purevolume&amp; from the line, it works just like the Google script.<br>However, with the purevolume&amp; addition, I get<div class="codebox"><p>Code: </p><pre><code>[13:00] Tcl error [pub:pv]: can't read "query": no such variable</code></pre></div>Is the query too long or something?<br>I'm really new to TCL, so it's probably a dumb mistake.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8771">jfb392</a> — Sun Jun 17, 2007 2:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
