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

	<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>2014-01-10T08:35:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2014-01-10T08:35:52-04:00</updated>

		<published>2014-01-10T08:35:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102460#p102460</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102460#p102460"/>
		<title type="html"><![CDATA[Add URL shorteners to Google script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102460#p102460"><![CDATA[
Little bump. I think the Webby script already has an example, see <a href="http://forum.egghelp.org/viewtopic.php?p=88724#88724" class="postlink">http://forum.egghelp.org/viewtopic.php?p=88724#88724</a><br><br>I am willing to paypal a donation for helping me out and have got a positive reference to confirm here on the forums.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Fri Jan 10, 2014 8:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2013-12-09T12:13:53-04:00</updated>

		<published>2013-12-09T12:13:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102285#p102285</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102285#p102285"/>
		<title type="html"><![CDATA[Add URL shorteners to Google script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102285#p102285"><![CDATA[
Little bump.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Mon Dec 09, 2013 12:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2013-09-24T13:33:09-04:00</updated>

		<published>2013-09-24T13:33:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102065#p102065</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102065#p102065"/>
		<title type="html"><![CDATA[Add URL shorteners to Google script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102065#p102065"><![CDATA[
I currently use the following Google script which works fine. Would it be possible to have it shorten the long Google links with tinyurl / goo.gl / ow.ly / su.pr etc.? Best would be to have a switch so that I can easily change or even randomize the shortener service.<br><div class="codebox"><p>Code: </p><pre><code>################################################################################################  ## Advanced Google.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help  ##  ##################################################################################################  ## To use this script you must set channel flag +google (ie .chanset #chan +google) ##  ################################################################################################################################################################################################  ##                             Start Setup.                                         ##  ################################################################################################## Change the character between the "" below to change the command character/trigger.       ##set googlecmdchar "!"proc google {nick host hand chan type search} {  if {[lsearch -exact [channel info $chan] +google] != -1} {## Change the country code between the "" below to change the language of your results.     ##    set googlectry "en"## Change the number between the "" below to change the number of results returned.         ##    set googlemax "5"## Change the characters between the "" below to change the logo shown with each result.    ####    set googlelogo "\002\0032G\0034o\0038o\00314g\0039l\0034e\002\003"    set googlelogo ""#    set googlelogo "\00312G\003\00304o\003\00307o\003\00312g\003\00303l\003\00304e\003"## Change the format codes between the "" below to change the color/state of the text.      ##    set textf ""## Change the format codes between the "" below to change the color/state of the links.     ##    set linkf ""################################################################################################  ##                           End Setup.                                              ## ################################################################################################    set googlesite ajax.googleapis.com    set googleurl /ajax/services/search/${type}?v=1.0&amp;rsz=large&amp;q=${search}&amp;ql=${googlectry}&amp;lr=lang_${googlectry}    if {[catch {set googlesock [socket -async $googlesite 80]} sockerr]} {      putlog "$googlesite $googleurl $sockerr error"      return 0      } else {      puts $googlesock "GET $googleurl HTTP/1.0"      puts $googlesock "Host: $googlesite"      puts $googlesock "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1"      puts $googlesock ""      flush $googlesock      while {![eof $googlesock]} {        set googlevar " [gets $googlesock] "        set googlelink [regexp -all -nocase -inline {\"url\":\"([^\"]*)\"} $googlevar]        set googledesc [regexp -all -nocase -inline {\"title\":\"([^\"]*)\"} $googlevar]        if {$googledesc != "" &amp;&amp; $googlelink != ""} {          for {set x 1} {$x &lt;= [expr 2 * $googlemax]} {incr x 2} {            putquick "PRIVMSG $chan :$googlelogo $textf[dehex [lindex $googledesc $x]] $linkf[dehex [lindex $googlelink $x]]"          }        }      }      close $googlesock      return 0    }  }}proc asc {chr} {  scan $chr %c asc  return $asc}proc chr {asc} { return [format %c $asc] }proc hex {decimal} { return [format %x $decimal] }proc decimal {hex} { return [expr 0x$hex] }proc dehex {string} {  regsub -all {^\{|\}$} $string "" string  set string [subst [regsub -nocase -all {\\u([a-f0-9]{4})} $string {[format %c [decimal \1]]}]]  set string [subst [regsub -nocase -all {\%([a-f0-9]{2})} $string {[format %c [decimal \1]]}]]  set string [subst [regsub -nocase -all {\&amp;#([0-9]{2});} $string {[format %c \1]}]]##  set string [string map {" \" · · &amp; &amp; &lt;b&gt; \002 &lt;/b&gt; \002} $string]  set string [string map {" \" · · &amp; &amp; &lt;b&gt; "" &lt;/b&gt; ""} $string]  return $string}proc urlencode {string} {  regsub -all {^\{|\}$} $string "" string  return [subst [regsub -nocase -all {([^a-z0-9])} $string {%[format %x [scan "\\&amp;" %c]]}]]}proc googleweb {nick host hand chan args} { google $nick $host $hand $chan "web" [urlencode $args] }proc googlelocal {nick host hand chan args} { google $nick $host $hand $chan "local" [urlencode $args] }proc googlevideo {nick host hand chan args} { google $nick $host $hand $chan "video" [urlencode $args] }proc googlenews {nick host hand chan args} { google $nick $host $hand $chan "news" [urlencode $args] }proc googlebook {nick host hand chan args} { google $nick $host $hand $chan "books" [urlencode $args] }proc googleimage {nick host hand chan args} { google $nick $host $hand $chan "images" [urlencode $args] }proc googlepatent {nick host hand chan args} { google $nick $host $hand $chan "patent" [urlencode $args] }bind pub - ${googlecmdchar}google googlewebbind pub - ${googlecmdchar}glocal googlelocalbind pub - ${googlecmdchar}gvideo googlevideobind pub - ${googlecmdchar}gnews googlenewsbind pub - ${googlecmdchar}gbook googlebookbind pub - ${googlecmdchar}gimage googleimagebind pub - ${googlecmdchar}gpatent googlepatentsetudef flag google</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Tue Sep 24, 2013 1:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
