I needed users to be able to check what was on at random times so I added a little on text trigger:
on *:text:!nowplaying:#: {
tokenize 44 $regsubex($regsubex($1-,/<.+?>/g,),/&#;/g,$chr(\1))
%nowplaying = $md5($7)
}
I'm not sure I need the tokenize line in there line in there, but it doesn't seem to hurt anything.
I do need to figure out how to convert certain characters to be regular text and I suck at regex.
For example an apostrophe shows in the channel as ampersand pos semi-colon
Cool script though,
Thanks
Tweeting from the bot?
I am having difficulty figuring out how to tweet directly from the bot, I was able to do it under the old version of the script using this
"alias quick_update twitter_statuses_update echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret $1-"
That doesn't seem to work any more
I was getting the same thing. I fin you have to change that top section to this:
;===============================================================================
;Syntax quick_update update text here note requires that you complete setup
alias quick_update twitter_statuses_update echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret $1-
;Syntax twitter_statuses_update echo -a consumer_key consumer_secret oauth_token oauth_token_secret status update here
;Note that echo -a can be changed to msg $chan or notice $nick ( must be two words )
alias -l twitter_statuses_update {
var %ots $gmt, %sockname $+(twitter_statuses_update,$network,$ticks,$r(1,10000)), %once $md5(%sockname)
var %os $signature(post,http://api.twitter.com/1/statuses/update.xml,$3,$4,$5,$6,%once,%ots,$+(status=,$tuenc($7-)))
sockopen %sockname twitter.com 80
sockmark %sockname $1-2 $space2comma($+(oauth_nonce=,$qt(%once)) $osmqt $+(oauth_timestamp=,$qt(%ots)) $+(oauth_consumer_key=,$qt($tuenc($3))) $&
$+(oauth_token=,$qt($tuenc($5))) $+(oauth_signature=,$qt($suenc(%os))) $overqt) $+(status=,$tuenc($7-))
}
on :sockopen:twitter_statuses_update: {
if ($sockerr) echo -st Socket Error $nopath($script)
else {
tokenize 32 $sock($sockname).mark
sockwrite -n $sockname POST /1/statuses/update.xml HTTP/1.1
sockwrite -n $sockname Host: api.twitter.com
sockwrite -n $sockname User-Agent: Lawnmower 9.64
sockwrite -n $sockname Authorization: OAuth realm="/1/statuses/update.xml", $3
sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -n $sockname Content-Length: $len($4)
sockwrite -n $sockname
sockwrite -n $sockname $4
sockwrite -n $sockname
}
}