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

	<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-01-30T08:12:45-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-01-30T08:12:45-04:00</updated>

		<published>2010-01-30T08:12:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91900#p91900</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91900#p91900"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91900#p91900"><![CDATA[
speechless, well done, I`ll look forward to this script it would be very much useful <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=10393">Football</a> — Sat Jan 30, 2010 8:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sdays]]></name></author>
		<updated>2010-01-30T03:48:49-04:00</updated>

		<published>2010-01-30T03:48:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91899#p91899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91899#p91899"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91899#p91899"><![CDATA[
Nice speechless so your planning on making it post text for yourchan account I found a script on google and edited it a bit I know it sucks but it may still work:<br><div class="codebox"><p>Code: </p><pre><code>set ::setup(trigger)   "!twitterp"set ::setup(apibase)   "http://twitter.com/"set ::setup(apiupdate) "statuses/update.json"set ::setup(url)       $::setup(apibase)$::setup(apiupdate)set ::setup(user)      "user"set ::setup(pass)      "pass"set ::setup(curl)      "/usr/bin/curl"set ::setup(confirm)   "\002Success!\017 @ $::setup(apibase)$::setup(user)"# bindsbind pub - $::setup(trigger) twitcl:twitter############################################proc twitcl:twitter {nick uhost handle channel text} {  global twitcl  set text [twitcl:mapevil $text]  if {[catch {exec $::setup(curl) --basic --user "$::setup(user):$::setup(pass)" -d "status=($nick): $text" $::setup(url)} result]} {    putquick "PRIVMSG $channel : $::setup(confirm)"  } else {  putquick "PRIVMSG $channel : \002Err.. Something b0rked!\017"  }}# map 'em evil charsproc twitcl:mapevil {string} {  global twitcl  return [string map {\&lt; &lt; \&gt; &gt;} $string]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8306">sdays</a> — Sat Jan 30, 2010 3:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-27T21:20:01-04:00</updated>

		<published>2010-01-27T21:20:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91876#p91876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91876#p91876"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91876#p91876"><![CDATA[
Took some time to actually test this myself and fixed a few bugs here and there. Also expanded the syntax for the last tweet. This will allow tweets to carry over the url's mentioned when parsing syntax. Rather than scrubbing all html elements out, this cleverly leaves them intact but neatly. This should look more professional. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>This also falls in line with some of my other scripts. Meaning you can use Trf or zlib packages and make your twitter requests using Gzip saving you time and bandwidth. Falling in line also means "full support for utf-8" is a must, and also offered _if_ your bot is utf-8 patched. You can read tweets <span style="text-decoration:underline">in any language</span>. It's just fine alrighty if you do.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><blockquote class="uncited"><div>&lt;speechles&gt; !twitter whitehouse<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Getting Status For: whitehouse...<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Name: <strong class="text-strong">The White House</strong>; Location: <strong class="text-strong">Washington, DC USA</strong>; Following: <strong class="text-strong">87</strong>; Followers: <strong class="text-strong">1,694,567</strong>; Listed: <strong class="text-strong">13,925</strong>; Total Tweets: <strong class="text-strong">202</strong>.<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Last Tweet: [about 4 hours ago] Hit him with your best shot: submit your questions for Obama, vote on others via YT. He answers Monday ( <a href="http://bit.ly/QaZPN" class="postlink">http://bit.ly/QaZPN</a> )<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  <a href="http://twitter.com/whitehouse" class="postlink">http://twitter.com/whitehouse</a><br><br>&lt;speechles&gt; !twitter google<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Getting Status For: google...<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Name: <strong class="text-strong">A Googler</strong>; Location: <strong class="text-strong">Mountain View, CA</strong>; Following: <strong class="text-strong">222</strong>; Followers: <strong class="text-strong">2,119,659</strong>; Listed: <strong class="text-strong">21,138</strong>; Total Tweets: <strong class="text-strong">1,083</strong>.<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  Last Tweet: [41 minutes ago] Have you heard? The growth of Unicode on the web is nearing 50%. ( <a href="http://bit.ly/ddGFd9" class="postlink">http://bit.ly/ddGFd9</a> ) #unicode ( <a href="http://twitter.com/search?q=%23unicode" class="postlink">http://twitter.com/search?q=%23unicode</a> )<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]:  <a href="http://twitter.com/google" class="postlink">http://twitter.com/google</a></div></blockquote>This is now a full featured script. Does not use cookies, or allow logins (yet *), but it does handle multiple redirects and should catch all messages (protected, suspended, and locked). Enjoy and have a fun ;P<br><br>For those who want to get it: <a href="http://ereader.kiczek.com/twitter.tcl" class="postlink">Click here</a><br><br>* Note: I have special plans to add a second trigger to this script, which will allow you to set up individual accounts for each of your channels. It would work like this:<br>&lt;Nick&gt; !tweet Does this even work?<br>The bot then logs into the twitter account assigned to that specific channel the command was issued in and posts this as a tweet. The form the tweet takes would basically be, "&lt;Nick&gt; Does this even work?". Then later typing "!twitter &lt;your channel's account name here&gt;" would reveal the last person to use the !tweet command in that channel as well as the url to the full twitterings. This would fully integrate the capability of twitter onto IRC for your users. This is probably more than you had envisioned, but this would be rather interesting to see. This weekend it should be realized and available. Below is an example:<blockquote class="uncited"><div>** in #eggdrop which is tied to the twitter account "mychan"...<br><br>&lt;speechles&gt; !tweet CAN YOU HEAR MY #EGGDROP <a href="http://forum.egghelp.org/viewtopic.php?p=91876" class="postlink">http://forum.egghelp.org/viewtopic.php?p=91876</a><br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]: [#eggdrop@mychan] Your tweet was successful!<br><br>&lt;speechles&gt; !twitter mychan<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]: Getting Status For: mychan...<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]: Name: <strong class="text-strong">#eggdrop</strong>; Location: <strong class="text-strong">@My network</strong>; Following: <strong class="text-strong">510</strong>; Followers: <strong class="text-strong">48</strong>; Listed: <strong class="text-strong">113</strong>; Total Tweets: <strong class="text-strong">115</strong>.<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]: Last Tweet: [32 seconds ago] &lt;speechles&gt; CAN YOU HEAR MY #EGGDROP ( <a href="http://twitter.com/search?q=%23EGGDROP" class="postlink">http://twitter.com/search?q=%23EGGDROP</a> ) ( <a href="http://forum.egghelp.org/viewtopic.php?p=91876" class="postlink">http://forum.egghelp.org/viewtopic.php?p=91876</a> )<br>&lt;sp33chy&gt; [<strong class="text-strong">Twitter</strong>]: <a href="http://twitter.com/mychan" class="postlink">http://twitter.com/mychan</a></div></blockquote>Stay tuned...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Jan 27, 2010 9:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-01-27T14:02:44-04:00</updated>

		<published>2010-01-27T14:02:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91868#p91868</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91868#p91868"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91868#p91868"><![CDATA[
This is a really great script, any chance for a link to the fixed script?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Wed Jan 27, 2010 2:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sdays]]></name></author>
		<updated>2010-01-26T11:02:24-04:00</updated>

		<published>2010-01-26T11:02:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91857#p91857</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91857#p91857"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91857#p91857"><![CDATA[
putserv "$to :$twitter(logo) Houston, we have a problem. Oxygen level is low. Atmospheric pressure is dropping." <br><br>I get that message than the profile has been locked.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8306">sdays</a> — Tue Jan 26, 2010 11:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-25T07:34:24-04:00</updated>

		<published>2010-01-25T07:34:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91846#p91846</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91846#p91846"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91846#p91846"><![CDATA[
This will trap redirects as errors and display the message. (error condition 4)...<div class="codebox"><p>Code: </p><pre><code>Code:# Twitter by Warlord v1.1b# Rewrite by egghelp and tweaked by warlord..# Type in partyline: ".chanset #channel +twitter" to enable it.# -- config begins# This is the twitter logo.set twitter(logo) "\[\002\00311Twitter\002\003]:"# Set user agent.set twitter(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"# Set the url baseset twitter(url) "http://twitter.com/"# Set the output style here:# %chan == $chan, %nick == $nick# no other variables can be usedset twitter(output) "PRIVMSG %chan"# -- script begins# Chanset command.setudef flag twitter# check if http version 2.5 or greater is used# if so, we can use utf-8 features, otherwise# fall back to standard iso8859-1if {[catch {package require http 2.5} e] != 0} {  set twitter(noutf8) 1  package require http}bind pub - !twitter proc:twitterproc proc:twitter {nick uhand handle chan input} {  if {[channel get $chan twitter]} {    global twitter    # string map in replacements for output    set to [string map [list "%chan" $chan "%nick" $nick] $twitter(output)]    if {![llength [split $input]]} {      putserv "$to :$twitter(logo) Please be more specific I need a user name example: !twitter username"    } else {      # spam our header message before we attempt to get data..      putquick "$to :$twitter(logo) Getting Status For: $input..."      # proper support for utf-8; twitter uses utf-8      # *requires http 2.5+      if {[info exists twitter(noutf8)]} {        set http [::http::config -useragent $twitter(agent)]      } else {        set http [::http::config -useragent $twitter(agent) -urlencoding "utf-8"]      }      # fancy url constructor; utf-8 safe; special character safe      # *uses http packages format query      foreach word [split $input] { lappend query [http::formatQuery $word] }      # error catching, this also captures our url into the variable u      catch { set http [::http::geturl "[set u "$twitter(url)[join $query +]"]" -timeout 5000]} error      # error condition 1, socket error or other general error      if {![string match -nocase "::http::*" $error]} {        putserv "$to :$twitter(logo) [string totitle [string map {"\n" " | "} $error]] \( $u \)"        return 0      }      # error condition 2, http error      if {![string equal -nocase [::http::status $http] "ok"]} {        putserv "$to :$twitter(logo) [string totitle [::http::status $http]] \( $u \)"        return 0      }      # error condition 3, 40* error      if {[string equal -nocase "40*" [::http::ncode $http]]} {        putserv "$to :$twitter(logo) \[[::http::ncode $http]\] Sorry, that page doesn't exist! \( $u \)"        return 0      }      # error condition 4, 30* error , these redirect to special pages (suspended, etc)      if {[string equal -nocase "30*" [::http::ncode $http]]} {        putserv "$to :$twitter(logo) \[[::http::ncode $http]\] Sorry, the profile you were trying to view has been suspended due to strange activity. \( $u \)"        return 0      }      # get data.         set html [::http::data $http]      # cleanup http array      ::http::cleanup $http      regsub -all "\n" $html "" html               # scrape output         if {[regexp -- {&lt;span id="following_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - following]} {set following [string trim $following]}      if {[regexp -- {&lt;span id="follower_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - followers]} {set followers [string trim $followers]}      if {[regexp -- {&lt;span id="lists_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - listed]} {set listed [string trim $listed]}      if {[regexp -- {&lt;span id="update_count" class="stat_count"&gt;(.+?)&lt;/span&gt;} $html - totaltweets]} {set totaltweets [string trim $totaltweets]}      if {[regexp -- {&lt;span class="entry-content"&gt;(.+?)&lt;/span&gt;} $html - ltweet]} {        # scrub html elements out        regsub -all -- {&lt;a class=.*?&gt;} [string trim $ltweet] "" ltweet        regsub -all -- {&lt;a href=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;/a&gt;} $ltweet "" ltweet      }      # check if a variable we scraped exists      if {[info exists following]} {        # protected tweets?        if {[regexp -- {&lt;div class="protected-box"&gt;} $html]} {          # yes          putserv "$to :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: Tweets Protected."               putserv "$to :$twitter(logo) This person has protected their tweets."        } else {          # no          putserv "$to :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: $totaltweets."          # a last tweet?          if {[info exists ltweet]} {            # yes            putserv "$to :$twitter(logo) Last Tweet: $ltweet"          } else {            # no            putserv "$to :$twitter(logo) I'm sorry, this user has no tweets."          }        }        # give url for clickability        putserv "$to :$twitter(logo) $u"      } else {        # if not, give a funny message, bascially the regexp's above are        # broken and need maintenance when this message appears.        putserv "$to :$twitter(logo) Houston, we have a problem. Oxygen level is low. Atmospheric pressure is dropping."      }    }  }}putlog "Twitter-1.1b - Originally by Warlord/Rewrite by egghelp and tweaked by warlord.."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jan 25, 2010 7:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sdays]]></name></author>
		<updated>2010-01-24T20:34:09-04:00</updated>

		<published>2010-01-24T20:34:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91838#p91838</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91838#p91838"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91838#p91838"><![CDATA[
[13:52:27] &lt;@Warlord&gt; !twitter gov<br>[13:52:28] &lt;@ps3&gt; [Twitter]: Getting Status For: gov...<br>[13:52:28] &lt;@ps3&gt; [Twitter]: Houston, we have a problem<br><br>So I tried adding this code and nothing..<br><br><div class="codebox"><p>Code: </p><pre><code>if {[regexp -- {&lt;body class="static" id="suspended"&gt;} $html]} {   putserv "$to :$twitter(logo) Sorry, the profile you were trying to view has been suspended due to strange activity."   return 0        }</code></pre></div>The main url is: <a href="http://twitter.com/gov" class="postlink">http://twitter.com/gov</a> but it redirects to <a href="http://twitter.com/suspended" class="postlink">http://twitter.com/suspended</a> not sure if the redirect messes it up or what, any idea?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8306">sdays</a> — Sun Jan 24, 2010 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-23T16:58:42-04:00</updated>

		<published>2010-01-23T16:58:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91801#p91801</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91801#p91801"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91801#p91801"><![CDATA[
here it is slightly tweaked further to trap 40* codes before grabbing html (error condition 3) also cleans up the url encoder to be faster, added http::cleanup, dynamic putserv messaging.<div class="codebox"><p>Code: </p><pre><code># Twitter by Warlord v1.1b# Rewrite by egghelp and tweaked by warlord..# Type in partyline: ".chanset #channel +twitter" to enable it.# -- config begins# This is the twitter logo.set twitter(logo) "\[\002\00311Twitter\002\003]:"# Set user agent.set twitter(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"# Set the url baseset twitter(url) "http://twitter.com/"# Set the output style here:# %chan == $chan, %nick == $nick# no other variables can be usedset twitter(output) "PRIVMSG %chan"# -- script begins# Chanset command.setudef flag twitter# check if http version 2.5 or greater is used# if so, we can use utf-8 features, otherwise# fall back to standard iso8859-1if {[catch {package require http 2.5} e] != 0} {  set twitter(noutf8) 1  package require http}bind pub - !twitter proc:twitterproc proc:twitter {nick uhand handle chan input} {  if {[channel get $chan twitter]} {    global twitter    # string map in replacements for output    set to [string map [list "%chan" $chan "%nick" $nick] $twitter(output)]    if {![llength [split $input]]} {      putserv "$to :$twitter(logo) Please be more specific I need a user name example: !twitter username"    } else {      # spam our header message before we attempt to get data..      putquick "$to :$twitter(logo) Getting Status For: $input..."      # proper support for utf-8; twitter uses utf-8      # *requires http 2.5+      if {[info exists twitter(noutf8)]} {        set http [::http::config -useragent $twitter(agent)]      } else {        set http [::http::config -useragent $twitter(agent) -urlencoding "utf-8"]      }      # fancy url constructor; utf-8 safe; special character safe      # *uses http packages format query      foreach word [split $input] { lappend query [http::formatQuery $word] }      # error catching, this also captures our url into the variable u      catch { set http [::http::geturl "[set u "$twitter(url)[join $query +]"]" -timeout 5000]} error      # error condition 1, socket error or other general error      if {![string match -nocase "::http::*" $error]} {        putserv "$to :$twitter(logo) [string totitle [string map {"\n" " | "} $error]] \( $u \)"        return 0      }      # error condition 2, http error      if {![string equal -nocase [::http::status $http] "ok"]} {        putserv "$to :$twitter(logo) [string totitle [::http::status $http]] \( $u \)"        return 0      }      # error condition 3, 40* error      if {[string equal -nocase "40*" [::http::ncode $http]]} {        putserv "$to :$twitter(logo) \[[::http::ncode $http]\] Sorry, that page doesn't exist! \( $u \)"        return 0      }      # get data.         set html [::http::data $http]      # cleanup http array      ::http::cleanup $http      regsub -all "\n" $html "" html                # scrape output          if {[regexp -- {&lt;span id="following_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - following]} {set following [string trim $following]}      if {[regexp -- {&lt;span id="follower_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - followers]} {set followers [string trim $followers]}      if {[regexp -- {&lt;span id="lists_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - listed]} {set listed [string trim $listed]}      if {[regexp -- {&lt;span id="update_count" class="stat_count"&gt;(.+?)&lt;/span&gt;} $html - totaltweets]} {set totaltweets [string trim $totaltweets]}      if {[regexp -- {&lt;span class="entry-content"&gt;(.+?)&lt;/span&gt;} $html - ltweet]} {        # scrub html elements out        regsub -all -- {&lt;a class=.*?&gt;} [string trim $ltweet] "" ltweet        regsub -all -- {&lt;a href=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;/a&gt;} $ltweet "" ltweet      }      # check if a variable we scraped exists      if {[info exists following]} {        # protected tweets?        if {[regexp -- {&lt;div class="protected-box"&gt;} $html]} {          # yes          putserv "$to :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: Tweets Protected."                putserv "$to :$twitter(logo) This person has protected their tweets."        } else {          # no          putserv "$to :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: $totaltweets."          # a last tweet?          if {[info exists ltweet]} {            # yes            putserv "$to :$twitter(logo) Last Tweet: $ltweet"          } else {            # no            putserv "$to :$twitter(logo) I'm sorry, this user has no tweets."          }        }        # give url for clickability        putserv "$to :$twitter(logo) $u"      } else {        # if not, give a funny message, bascially the regexp's above are        # broken and need maintenance when this message appears.        putserv "$to :$twitter(logo) Houston, we have a problem. Oxygen level is low. Atmospheric pressure is dropping."      }    }  }}putlog "Twitter-1.1b - Originally by Warlord/Rewrite by egghelp and tweaked by warlord.."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Jan 23, 2010 4:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sdays]]></name></author>
		<updated>2010-01-23T04:11:21-04:00</updated>

		<published>2010-01-23T04:11:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91793#p91793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91793#p91793"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91793#p91793"><![CDATA[
Thanks speechless I found few bugs which wouldn't let it work so I played around with it and fixed it and added user/protected tweaks check as well. Anyways Here is the script now just if anyone wants to use it or edit or something.<br><br>Edited updated.<br><div class="codebox"><p>Code: </p><pre><code># Twitter by Warlord v1.1a# Rewrite by egghelp and tweaked by warlord.. # Type in partyline: ".chanset #channel +twitter" to enable it.# This is the twitter logo.set twitter(logo) "\[\002\00311Twitter\002\003]:"# Set user agent.set twitter(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"# Chanset command.setudef flag twitter# check if http version 2.5 or greater is used# if so, we can use utf-8 features, otherwise# fall back to standard iso8859-1if {[catch {package require http 2.5} e] != 0} {   set twitter(noutf8) 1  package require http}bind pub - !twitter proc:twitterproc proc:twitter {nick uhand handle chan input} {  if {[channel get $chan twitter]} {    global twitter    if {![llength [split $input]]} {      putserv "PRIVMSG $chan :$twitter(logo) Please be more specific I need a user name example: !twitter username"      } else {      # spam our header message before we attempt to get data..      putquick "PRIVMSG $chan :$twitter(logo) Getting Status For: $input..."      # proper support for utf-8; twitter uses utf-8      # *requires http 2.5+      if {[info exists twitter(noutf8)]} {        set http [::http::config -useragent $twitter(agent)]        } else {        set http [::http::config -useragent $twitter(agent) -urlencoding "utf-8"]      }      # fancy url constructor; utf-8 safe; special character safe      # *uses http packages format query      foreach word [split $input] {        lappend query [lindex [split [http::formatQuery a $word] =] 1]      }      # error catching      catch { set http [::http::geturl "http://twitter.com/[join $query +]" -timeout 5000]} error        # error condition 1, socket error        if {![string match -nocase "::http::*" $error]} {          putserv "privmsg $chan :$twitter(logo) [string totitle [string map {"\n" " | "} $error]] \( $query \)"          return 0        }        # error condition 2, http error        if {![string equal -nocase [::http::status $http] "ok"]} {          putserv "privmsg $chan :$twitter(logo) [string totitle [::http::status $http]] \( $query \)"          return 0        }         # Get data.        set html [::http::data $http]        regsub -all "\n" $html "" html        #checks if the person protected their profile.        #checks to see if there is a username        if {[regexp -- {&lt;h2&gt;Sorry, that page doesn.t exist!&lt;/h2&gt;} $html]} {        putserv "privmsg $chan :$twitter(logo) There is no such username"        return 0      }                    if {[regexp -- {&lt;span id="following_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - following]} {set following [string trim $following]}      if {[regexp -- {&lt;span id="follower_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - followers]} {set followers [string trim $followers]}      if {[regexp -- {&lt;span id="lists_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - listed]} {set listed [string trim $listed]}      if {[regexp -- {&lt;span id="update_count" class="stat_count"&gt;(.+?)&lt;/span&gt;} $html - totaltweets]} {set totaltweets [string trim $totaltweets]}      if {[regexp -- {&lt;span class="entry-content"&gt;(.+?)&lt;/span&gt;} $html - ltweet]} {         set ltweet [string trim $ltweet]        # scrub html elements out        regsub -all -- {&lt;a class=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;a href=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;/a&gt;} $ltweet "" ltweet      }      # check if a variable we scraped exists      if {[info exists following]} {        # if so, spamtastic!          if {[regexp -- {&lt;div class="protected-box"&gt;} $html]} {          putserv "PRIVMSG $chan :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: Tweets Protected."          putserv "privmsg $chan :$twitter(logo) This person has protected their tweets."          } else {            putserv "PRIVMSG $chan :$twitter(logo) Following: $following; Followers: $followers; Listed: $listed; Total Tweets: $totaltweets."            if {[info exists ltweet]} {            putserv "PRIVMSG $chan :$twitter(logo) Last Tweet: $ltweet"              } else {              putserv "PRIVMSG $chan :$twitter(logo) I'm sorry, this user has no tweets."            }          }          putserv "PRIVMSG $chan :$twitter(logo) http://twitter.com/$query"        } else {        # if not, give a funny message, bascially the regexp's above are        # broken and need maintenance when this message appears.        putserv "PRIVMSG $chan :Houston, we have a problem. Oxygen level is low. Atmospheric pressure is dropping."      }    }  }}putlog "Twitter-1.1a - Originally by Warlord/Rewrite by egghelp and tweaked by warlord.."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8306">sdays</a> — Sat Jan 23, 2010 4:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-22T17:50:51-04:00</updated>

		<published>2010-01-22T17:50:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91788#p91788</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91788#p91788"/>
		<title type="html"><![CDATA[Re: Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91788#p91788"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Twitter by sdays v1.0a# egghelp version.. YAYset twitter(logo) "Twitter"set twitter(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"# check if http version 2.5 or greater is used# if so, we can use utf-8 features, otherwise# fall back to standard iso8859-1if {[catch {package require http 2.5} e] != 0]} {  set twitter(noutf8) 1  package require http}setudef flag twitterbind pub - !twitter proc:twitterproc proc:twitter {nick uhand handle chan input} {  if {[channel get $chan twitter]} {    global twitter    if {![llength [split $input]]} {      putserv "PRIVMSG $chan :Please be more specific I need a user name example: !twitter username"    } else {      # spam our header message before we attempt to get data..      putquick "PRIVMSG $chan :\002$twitter(logo)\002: Getting Status For: $input..."      # proper support for utf-8; twitter uses utf-8      # *requires http 2.5+      if {[info exists twitter(noutf8)]} {        set http [::http::config -useragent $twitter(agent)]      } else {        set http [::http::config -useragent $twitter(agent) -urlencoding "utf-8"]      }      # fancy url constructor; utf-8 safe; special character safe      # *uses http packages format query      foreach word [split $input] {        lappend query [lindex [split [http::formatQuery a $word] =] 1]      }      # error catching      catch { set http [::http::geturl "http://twitter.com/[join $query +]" -timeout 5000 } error      # error condition 1, socket error      if {![string match -nocase "::http::*" $error]} {        putserv "privmsg $chan :\002$twitter(logo)\002: [string totitle [string map {"\n" " | "} $error]] \( $query \)"        return 0      }      # error condition 2, http error      if {![string equal -nocase [::http::status $http] "ok"]} {        putserv "privmsg $chan :\002$twitter(logo)\002: [string totitle [::http::status $http]] \( $query \)"        return 0      }      # no error, get data      set html [::http::data $http]      regsub -all "\n" $html "" html      if {[regexp -- {&lt;span id="following_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - following]} {set following [string trim $following]}      if {[regexp -- {&lt;span id="follower_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - followers]} {set followers [string trim $followers]}      if {[regexp -- {&lt;span id="lists_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - listed]} {set listed [string trim $listed]}      if {[regexp -- {&lt;span id="update_count" class="stat_count"&gt;(.+?)&lt;/span&gt;} $html - totaltweets]} {set totaltweets [string trim $totaltweets]}      if {[regexp -- {&lt;span class="entry-content"&gt;(.+?)&lt;/span&gt;} $html - ltweet]} {        set ltweet [string trim $ltweet]        # scrub html elements out        regsub -all -- {&lt;a class=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;a href=.*?&gt;} $ltweet "" ltweet        regsub -all -- {&lt;/a&gt;} $ltweet "" ltweet      }      # check if a variable we scraped exists      if {[info exists following]} {        # if so, spamtastic!        putserv "PRIVMSG $chan :Following: $following; Followers: $followers; Listed: $listed; Total Tweets: $totaltweets"        putserv "PRIVMSG $chan :Last Tweet: $ltweet"        putserv "PRIVMSG $chan :$query"      } else {        # if not, give a funny message, bascially the regexp's above are        # broken and need maintenance when this message appears.        putserv "PRIVMSG $chan :Houston, we have a problem. Oxygen level is low. Atmospheric pressure is dropping."      }    }  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jan 22, 2010 5:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sdays]]></name></author>
		<updated>2010-01-22T03:51:12-04:00</updated>

		<published>2010-01-22T03:51:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91781#p91781</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91781#p91781"/>
		<title type="html"><![CDATA[Twitter status problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91781#p91781"><![CDATA[
Well I requested twitter status few days ago and no one even bothered to reply but anyways I'm having a problem with it I got this far the code prob sucks but it half works..<br><br>Here is the problem I'm having:<br><br>[23:48:31] &lt;@Warlord&gt; !twitter google<br>[23:48:33] &lt;@Xbox360&gt; Twitter Getting Status For: google.<br>[23:48:34] &lt;@Xbox360&gt; Following: 219 Followers: 2,110,984 Listed: 20,284 Total Tweets: 161<br>[23:48:34] &lt;@Xbox360&gt; Last Tweet: RT @&lt;a class="tweet-url username" href="/googlenexusone"&gt;googlenexusone&lt;/a&gt;: In case you missed it, check out Patrick Boivin's awesome Nexus One unboxing video &lt;a href="<a href="http://bit.ly/6bAhxZ" class="postlink">http://bit.ly/6bAhxZ</a>" class="tweet-url web" rel="nofollow" target="_blank"&gt;<a href="http://bit.ly/6bAhxZ%3C/a" class="postlink">http://bit.ly/6bAhxZ&lt;/a</a>&gt; &lt;a href="/search?q=%23ninja" title="#ninja" class="tweet-url hashtag"&gt;#ninja&lt;/a&gt;<br>[23:48:36] &lt;@Xbox360&gt; <a href="http://twitter.com/google" class="postlink">http://twitter.com/google</a><br><br>It posts html code with the last tweet any idea?<br><div class="codebox"><p>Code: </p><pre><code>package require httpsetudef flag twitterset twitterlogo "Twitter"bind pub - !twitter proc:twitterset agent "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"proc proc:twitter {nick uhand handle chan input} {  if {[lsearch -exact [channel info $chan] +twitter] != -1} {    global botnick agent twitterlogo    if {[llength $input]==0} {      putserv "PRIVMSG $chan :Please be more specific I need a user name example: !twitter username"      } else {      set query "http://twitter.com/"      for { set index 0 } { $index&lt;[llength $input] } { incr index } {        set query "$query[lindex $input $index]"        if {$index&lt;[llength $input]-1} then {          set query "$query+"        }      }      set http [::http::config -useragent $agent]      set http [::http::geturl $query]      set html [::http::data $http]      regsub -all "\n" $html "" html      if {[regexp -- {&lt;span id="following_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - following]} {set following [string trim $following]}      if {[regexp -- {&lt;span id="follower_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - followers]} {set followers [string trim $followers]}      if {[regexp -- {&lt;span id="lists_count" class="stats_count numeric"&gt;(.+?) &lt;/span&gt;} $html - listed]} {set listed [string trim $listed]}      if {[regexp -- {&lt;span id="update_count" class="stat_count"&gt;(.+?)&lt;/span&gt;&lt;span&gt;Tweets&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;} $html - totaltweets]} {set totaltweets [string trim $totaltweets]}      if {[regexp -- {&lt;span class="entry-content"&gt;(.+?)&lt;/span&gt;} $html - ltweet]} {set ltweet [string trim $ltweet]}      putquick "PRIVMSG $chan :$twitterlogo Getting Status For: $input."      putserv "PRIVMSG $chan :Following: $following Followers: $followers Listed: $listed Total Tweets: $totaltweets"      putserv "PRIVMSG $chan :Last Tweet: $ltweet"      putserv "PRIVMSG $chan :$query"    }  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8306">sdays</a> — Fri Jan 22, 2010 3:51 am</p><hr />
]]></content>
	</entry>
	</feed>
