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

	<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>2011-11-27T13:42:49-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Trixar_za]]></name></author>
		<updated>2011-11-27T13:42:49-04:00</updated>

		<published>2011-11-27T13:42:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98264#p98264</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98264#p98264"/>
		<title type="html"><![CDATA[base64]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98264#p98264"><![CDATA[
Blake: Try speechless' twitter script named Birdy (<a href="http://forum.egghelp.org/viewtopic.php?t=17556" class="postlink">http://forum.egghelp.org/viewtopic.php?t=17556</a>). It also comes with the oauth.tcl and base64.tcl scripts, so you don't really need tcllib to use it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10958">Trixar_za</a> — Sun Nov 27, 2011 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2011-11-23T19:03:18-04:00</updated>

		<published>2011-11-23T19:03:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98245#p98245</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98245#p98245"/>
		<title type="html"><![CDATA[base64]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98245#p98245"><![CDATA[
<blockquote class="uncited"><div>Your system is missing the base64 tcl-package (not to be confused with distribution packages such as deb's and rpm's). A good source for this would be the tcllib project (<a href="http://sourceforge.net/projects/tcllib/" class="postlink">http://sourceforge.net/projects/tcllib/</a>). Just download and follow the installation instructions...</div></blockquote>I have sorted that but i now get the following error<br><div class="codebox"><p>Code: </p><pre><code>[22:54] &lt;TwitterBot&gt; [01:54:08] HTTP query failed: 401 (URL: http://twitter.com/statuses/friends.json) (QUERY_LIST: ) (QUERY: ) (METHOD: ) (USED METHOD: GET)</code></pre></div>Im assuming that the script may be out dated <br><div class="codebox"><p>Code: </p><pre><code># 0.1 - Feb 6 2010## Created by fedex and cd. www.summercat.com for updates## Requirements: Tcl 8.5+ and tcllib of some version (for base64, json)## Essentially a twitter client for IRC. Follow updates from tweets of all# those you follow on the given account.## Usage notes:#  - Stores states in variable $idfile file in eggdrop root directory#  - Default time between tweet fetches is 10 minutes. Alter the "bind time"#    option below to change to a different setting. Right now there is only#    options for 1 minute or 10 minutes.#  - Accepts commands issued by anyone right now! Perhaps if you wish to use#    in a channel with untrusted people, have one channel for output and one#    for controlling the script client style (+twitter)## Setup:#  - Place your username and pass in the variables user and pas#  - Set the channel variable as the channel where tweets will be output#  - .chanset #channel +twitter to provide access to !commands in #channel## Commands:#  - !twit - send a tweet#  - !twit_msg#  - !twit_trends#  - !follow#  - !unfollow#  - !twit_updates#  - !twit_msgs#  - !twit_search#  - !followers#  - !following#  - !retweet## TODO:#package require http# tcllib packagespackage require base64package require jsonnamespace eval twitter {variable user "xxxxxxx"variable pass "xxxxxxx"variable channel "#Tweets"# Only have one of these uncommented# Check for tweets every 1 min#bind time - "* * * * *" twitter::update# Check for tweets every 10 minbind time - "?0 * * * *" twitter::updatevariable idfile "twitter.last_id"#variable output_cmd "cd::putnow"variable output_cmd "putserv"variable last_idvariable last_updatevariable last_msgvariable status_url "http://twitter.com/statuses/update.json"variable home_url "http://api.twitter.com/1/statuses/home_timeline.json"variable msg_url "http://twitter.com/direct_messages/new.xml"variable msgs_url "http://twitter.com/direct_messages.json"variable trends_curr_url "http://search.twitter.com/trends/current.json"variable follow_url "http://twitter.com/friendships/create.json"variable unfollow_url "http://twitter.com/friendships/destroy.json"variable search_url "http://search.twitter.com/search.json"variable followers_url "http://twitter.com/statuses/followers.json"variable following_url "http://twitter.com/statuses/friends.json"variable retweet_url "http://api.twitter.com/1/statuses/retweet/"bind pub-|- "!twit" twitter::tweetbind pub-|- "!twit_msg" twitter::msgbind pub-|- "!twit_trends" twitter::trendsbind pub-|- "!follow" twitter::followbind pub-|- "!unfollow" twitter::unfollowbind pub-|- "!twit_updates" twitter::updatesbind pub-|- "!twit_msgs" twitter::msgsbind pub-|- "!twit_search" twitter::searchbind pub-|- "!followers" twitter::followersbind pub-|- "!following" twitter::followingbind pub-|- "!retweet" twitter::retweetbind evnt-|- "save" twitter::write_statessetudef flag twitter}# Output decoded/split string to given channelproc twitter::output {chan str} {set str [twitter::decode_html $str]foreach line [twitter::split_line 400 $str] {$twitter::output_cmd "PRIVMSG $chan :$line"}}# Format status updates and outputproc twitter::output_update {chan name id text} {twitter::output $chan "\[\002$name\002\] $text ($id)"}# Retweet given idproc twitter::retweet {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &lt; 1 || ![regexp {^\d+$} $argv]} {$twitter::output_cmd "PRIVMSG $chan :Usage: !retweet &lt;id&gt;"return}# Setup url since id is not given as params for some reason...set url "${twitter::retweet_url}${argv}.json"if {[catch {twitter::query $url {} POST} result]} {$twitter::output_cmd "PRIVMSG $chan :Retweet failure. ($argv) (You can't retweet your own updates!)"return}$twitter::output_cmd "PRIVMSG $chan :Retweet sent."}# Follow a user (by screen name)proc twitter::follow {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &lt; 1} {$twitter::output_cmd "PRIVMSG $chan :Usage: !follow &lt;screen name&gt;"return}if {[catch {twitter::query $twitter::follow_url [list screen_name $argv]} result]} {$twitter::output_cmd "PRIVMSG $chan :Twitter failed or already friends with $argv!"return}if {[dict exists $result error]} {twitter::output $chan "Follow failed ($argv): [dict get $result error]"return}twitter::output $chan "Now following [dict get $result screen_name]!"}# Unfollow a user (by screen name)proc twitter::unfollow {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &lt; 1} {$twitter::output_cmd "PRIVMSG $chan :Usage: !unfollow &lt;screen name&gt;"return}if {[catch {twitter::query $twitter::unfollow_url [list screen_name $argv]} result]} {$twitter::output_cmd "PRIVMSG $chan :Unfollow failed. ($argv)"return}if {[dict exists $result error]} {twitter::output $chan "Unfollow failed ($argv): [dict get $result error]"return}twitter::output $chan "Unfollowed [dict get $result screen_name]."}# Get last n, n [1, 20] updatesproc twitter::updates {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &lt; 1 || ![string is integer $argv] || $argv &gt; 20 || $argv &lt; 1} {$twitter::output_cmd "PRIVMSG $chan :Usage: !twit_updates &lt;#1 to 20&gt;"return}if {[catch {twitter::query $twitter::home_url [list count $argv]} result]} {$twitter::output_cmd "PRIVMSG $chan :Retrieval error."return}if {[llength $result] == 0} {$twitter::output_cmd "PRIVMSG $chan :No updates."return}set result [lreverse $result]foreach status $result {dict with status {#twitter::output $chan "\[\002[dict get $user screen_name]\002\] $text"twitter::output_update $chan [dict get $user screen_name] $id $text}}}# Return top 5 results for query $argvproc twitter::search {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &lt; 1 || [string length $argv] &gt; 140} {$twitter::output_cmd "PRIVMSG $chan :Usage: !twit_search &lt;string 140 chars or less&gt;"return}if {[catch {twitter::query $twitter::search_url [list q $argv]} data]} {$twitter::output_cmd "PRIVMSG $chan :Search error ($argv)"return}if {[dict exists $data error]} {twitter::output $chan "Search failed ($argv): [dict get $result error]"return}set results [dict get $data results]set count 0foreach result $results {twitter::output $chan "#[incr count] \002[dict get $result from_user]\002 [dict get $result text]"if {$count &gt; 4} {break}}}# Return latest followers (up to 100)proc twitter::followers {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[catch {twitter::query $twitter::followers_url} result]} {$twitter::output_cmd "PRIVMSG $chan :Error fetching followers."}# Make first followers -&gt; last followersset result [lreverse $result]set followers []foreach user $result {set followers "$followers[dict get $user screen_name] "}twitter::output $chan "Followers: $followers"}# Returns the latest users following acct is following (up to 100)proc twitter::following {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[catch {twitter::query $twitter::following_url} result]} {$twitter::output_cmd "PRIVMSG $chan :Error fetching friends."return}# Make first following -&gt; last followingset result [lreverse $result]set following []foreach user $result {set following "$following[dict get $user screen_name] "}twitter::output $chan "Following: $following"}# Get trendsproc twitter::trends {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[catch {twitter::query $twitter::trends_curr_url} result]} {$twitter::output_cmd "PRIVMSG $chan :Trend fetch failed!"return}set trends [dict get $result trends]set output []set count 0foreach day [dict keys $trends] {foreach trend [dict get $trends $day] {set output "$output\002#[incr count]\002 [dict get $trend name] "}}twitter::output $chan $output}# Direct messages# Get last n, n [1, 20] messages or new if no argumentproc twitter::msgs {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] == 1 &amp;&amp; [string is integer $argv] &amp;&amp; $argv &lt; 20} {set params [list count $argv]} else {set params [list since_id $twitter::last_msg]}if {[catch {twitter::query $twitter::msgs_url $params GET} result]} {$twitter::output_cmd "PRIVMSG $chan :Messages retrieval failed."return}if {[llength $result] == 0} {$twitter::output_cmd "PRIVMSG $chan :No new messages."return}foreach msg $result {dict with msg {if {$id &gt; $twitter::last_msg} {set twitter::last_msg $id}twitter::output $chan "\002From\002 $sender_screen_name: $text ($created_at)"}}}# Send direct message to a userproc twitter::msg {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[llength [split $argv]] &lt; 2 || [string length [join [lrange [split $argv] 1 end]]] &gt; 140} {$twitter::output_cmd "PRIVMSG $chan :Usage: !twit_msg &lt;username&gt; &lt;msg 140 chars or less&gt;"return}set l [list screen_name [lindex $argv 0] text [lrange $argv 1 end]]if {[catch {twitter::query $twitter::msg_url $l} data]} {$twitter::output_cmd "PRIVMSG $chan :Message to \002$argv\002 failed! (Are they following you?)"} else {twitter::output $chan "Message sent."}}# Send status update (tweet)proc twitter::tweet {nick uhost hand chan argv} {if {![channel get $chan twitter]} { return }if {[string length $argv] &gt; 140 || $argv == ""} {$twitter::output_cmd "PRIVMSG $chan :Usage: !tweet &lt;less than 140 characters&gt;"}if {[catch {twitter::query $twitter::status_url [list status $argv]} result]} {$twitter::output_cmd "PRIVMSG $chan :Tweet failed! HTTP error. ($argv)"return}set update_id [dict get $result id]if {$update_id == $twitter::last_update} {$twitter::output_cmd "PRIVMSG $chan :Tweet failed: Duplicate of tweet #$update_id. ($argv)"return}set twitter::last_update $update_idtwitter::output $chan "Tweet sent."}# Grab unseen status updatesproc twitter::update {min hour day month year} {if {[catch {twitter::query $twitter::home_url [list since_id $twitter::last_id]} result]} {putlog "Twitter is busy."return}set result [lreverse $result]foreach status $result {dict with status {#twitter::output $twitter::channel "\[\002[dict get $user screen_name]\002\] $text"twitter::output_update $twitter::channel [dict get $user screen_name] $id $textif {$id &gt; $twitter::last_id} {set twitter::last_id $id}}}}# Twitter http queryproc twitter::query {url {query_list {}} {http_method {}}} {set auth [base64::encode "${twitter::user}:${twitter::pass}"]set header [list Authorization [concat "Basic" $auth]]# Set http mode of queryif {$http_method eq "" &amp;&amp; $query_list ne ""} {set method POST} elseif {$http_method eq "" &amp;&amp; $query_list eq ""} {set method GET} else {set method $http_method}set query [http::formatQuery {*}$query_list]set token [http::geturl $url -headers $header -query $query -method $method]#if {$query_list ne ""} {#set query [http::formatQuery {*}$query_list]#set token [http::geturl $url -headers $header -query $query]#} else {#set token [http::geturl $url -headers $header]#}set data [http::data $token]set ncode [http::ncode $token]http::cleanup $tokenif {$ncode != 200} {putlog "HTTP query failed: $ncode (URL: $url) (QUERY_LIST: $query_list) (QUERY: $query) (METHOD: $http_method) (USED METHOD: $method)"error "HTTP query failed: $ncode"}return [json::json2dict $data]}# Get saved ids/stateproc twitter::get_states {} {if {[catch {open $twitter::idfile r} fid]} {set twitter::last_id 1set twitter::last_update 1set twitter::last_msg 1return}set data [read -nonewline $fid]set states [split $data \n]close $fidset twitter::last_id [lindex $states 0]set twitter::last_update [lindex $states 1]set twitter::last_msg [lindex $states 2]}# Save states to fileproc twitter::write_states {args} {set fid [open $twitter::idfile w]puts $fid $twitter::last_idputs $fid $twitter::last_updateputs $fid $twitter::last_msgclose $fid}# Split long line into list of strings for multi line output to irc# Splits into strings of ~max# by fedexproc twitter::split_line {max str} {set last [expr {[string length $str] -1}]set start 0set end [expr {$max -1}]set lines []while {$start &lt;= $last} {if {$last &gt;= $end} {set end [string last { } $str $end]}lappend lines [string trim [string range $str $start $end]]set start $endset end [expr {$start + $max}]}return $lines}# From perpleXa's urbandictionary script# Replaces html special chars with their hex equivalentproc twitter::decode_html {str} {set escapes {  \x20 " \x22 &amp; \x26 &amp;apos; \x27 – \x2D&lt; \x3C &gt; \x3E ˜ \x7E € \x80 ¡ \xA1¢ \xA2 £ \xA3 ¤ \xA4 ¥ \xA5 ¦ \xA6§ \xA7 ¨ \xA8 © \xA9 ª \xAA « \xAB¬ \xAC ­ \xAD ® \xAE &amp;hibar; \xAF ° \xB0± \xB1 ² \xB2 ³ \xB3 ´ \xB4 µ \xB5¶ \xB6 · \xB7 ¸ \xB8 ¹ \xB9 º \xBA» \xBB ¼ \xBC ½ \xBD ¾ \xBE ¿ \xBFÀ \xC0 Á \xC1 Â \xC2 Ã \xC3 Ä \xC4Å \xC5 Æ \xC6 Ç \xC7 È \xC8 É \xC9Ê \xCA Ë \xCB Ì \xCC Í \xCD Î \xCEÏ \xCF Ð \xD0 Ñ \xD1 Ò \xD2 Ó \xD3Ô \xD4 Õ \xD5 Ö \xD6 × \xD7 Ø \xD8Ù \xD9 Ú \xDA Û \xDB Ü \xDC Ý \xDDÞ \xDE ß \xDF à \xE0 á \xE1 â \xE2ã \xE3 ä \xE4 å \xE5 æ \xE6 ç \xE7è \xE8 é \xE9 ê \xEA ë \xEB ì \xECí \xED î \xEE ï \xEF ð \xF0 ñ \xF1ò \xF2 ó \xF3 ô \xF4 õ \xF5 ö \xF6÷ \xF7 ø \xF8 ù \xF9 ú \xFA û \xFBü \xFC ý \xFD þ \xFE ÿ \xFF}return [string map $escapes $str]}# Read states on loadtwitter::get_statesputlog "twitter 0.1 (c) fedex"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Wed Nov 23, 2011 7:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-11-23T18:45:30-04:00</updated>

		<published>2011-11-23T18:45:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98242#p98242</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98242#p98242"/>
		<title type="html"><![CDATA[base64]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98242#p98242"><![CDATA[
Your system is missing the base64 tcl-package (not to be confused with distribution packages such as deb's and rpm's). A good source for this would be the tcllib project (<a href="http://sourceforge.net/projects/tcllib/" class="postlink">http://sourceforge.net/projects/tcllib/</a>). Just download and follow the installation instructions...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Nov 23, 2011 6:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2011-11-23T18:26:26-04:00</updated>

		<published>2011-11-23T18:26:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98241#p98241</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98241#p98241"/>
		<title type="html"><![CDATA[base64]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98241#p98241"><![CDATA[
Hey <br><br>Im trying to use a twitter script but keep getting the following error can any one help with how i would install this package<blockquote class="uncited"><div>[01:22:22] Tcl error in file 'eggdrop.conf':<br>[01:22:22] can't find package base64<br>    while executing<br>"package require base64"<br>    (file "scripts/twitter.tcl" line 43)<br>    invoked from within<br>"source scripts/twitter.tcl"<br>    (file "eggdrop.conf" line 1352)<br>[01:22:22] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</div></blockquote>many thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Wed Nov 23, 2011 6:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
