Update Twitter

By SoxFarxAway777 on Aug 27, 2009

Allows one user to use a text command to update their twitter from mIRC.

Original script by hixxy: http://forum.swiftirc.net/viewtopic.php?f=34&t=21826&hilit=twitter

I've taken the aliases; Turned them into text triggers.

Since It shows up as "from API" on Twitter, I added [mIRC Tweet] (just to brag everytime I update :P )to the beginning of your status. Can be easily removed.

Syntax-
Replace username with your username; password is replaced with password; your name replaced by your nick on the IRC.
As hixxy explained, you may want to encode your password.
use //echo -a $encode(,m)
Then replace the password string with:
alias -l password return $decode(,m)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;Twitter Update/Direct Reply Script;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;Edit of Original Script by Hixxy;;;;;;;;;;;;;;;;;;;;
;;;http://forum.swiftirc.net/viewtopic.php?f=34&t=21826&hilit=twitter;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias -l username return *username*
alias -l password return *password*

alias -l raiseerror { 
echo -a * /twitter: $1- 
halt 
} 
alias -l urlencode return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2)) 

on *:TEXT:-Status *:#: { 
  if ($nick == *your name*) {
    hfree -w twitter 
    sockclose twitter 
    sockopen twitter twitter.com 80 
    sockmark twitter status= $+ $urlencode([mIRC Tweet] $2-) 
    msg $chan 00,01[04,01New Status00,01] $2- 
  }
  else { halt }
}
else 
on *:TEXT:-DR *:#: { 
  if ($nick == *your name*) {
    hfree -w twitter 
    sockclose twitter 
    sockopen twitter twitter.com 80 
    sockmark twitter status= $+ $urlencode(@ $+ $2 $3-)
    msg $chan 00,01[04,01Direct Reply @ $+ $2 Sent00,01]: $3- 
  } 
else { halt }
}
on *:sockopen:twitter:{ 
if ($sockerr) { 
sockclose twitter 
raiseerror socket error. Try again later. 
} 
var %s = sockwrite -n twitter 
%s POST /statuses/update.xml HTTP/1.1 
%s Host: twitter.com 
%s Authorization: Basic $encode($+($username,:,$password),m) 
%s Accept: */*, *.* 
%s Connection: close 
%s User-Agent: mIRC/ $+ $version 
%s Content-Type: application/x-www-form-urlencoded 
%s Content-Length: $len($sock(twitter).mark) 
%s 
%s $sock(twitter).mark 
} 
on *:sockread:twitter:{ 
var %data 
sockread %data 
if ($regex(%data,/(.+?)/)) { 
hfree -w twitter 
sockclose twitter 
raiseerror $regml(1) 
} 
if ($regex(%data,/<(.+?)>(.+?)/)) hadd -m twitter $regml(1) $regml(2) 
elseif (%data == ) .signal twitterpost 
}

Comments

Sign in to comment.
SoxFarxAway777   -  Feb 19, 2010

Did you bother reading the script? The trigger for a status update is -Status (then whatever you want for your update)

For a direct reply: -DR (username to reply to) (message)

 Respond  
MagicRevealer09   -  Feb 14, 2010

Whats the trigger?

 Respond  
SoxFarxAway777   -  Sep 02, 2009

That's weird. I just tested the updates myself. =/

 Respond  
GrimReaper   -  Sep 02, 2009

it still doesn't work even tho you may have updated things. oh well.. good script anyways. :>

 Respond  
SoxFarxAway777   -  Sep 02, 2009

It's not, actually. My script is based off that one, but I created triggers, as opposed to aliases.

I actually posted the status trigger on that subject; my username on the forum is xSlayer.

 Respond  
FordLawnmower   -  Sep 02, 2009

http://forum.swiftirc.net/viewtopic.php?f=34&t=21826&hilit=twitter
@SoxFarxAway777 this is a direct RIP of hixxy's script ;/
Why would you Post someone else's work like this?

 Respond  
Shinybot   -  Sep 02, 2009

I got a Error to Can you find the problem ?

 Respond  
SoxFarxAway777   -  Sep 01, 2009

Is anyone else getting this error? It works perfectly for me...

 Respond  
GrimReaper   -  Sep 01, 2009

I can't get it to work.. i keep getting the error "* /twitter: <" D:

 Respond  
SoxFarxAway777   -  Aug 28, 2009

It does have direct messaging. Type -DR @name

 Respond  
uneek   -  Aug 28, 2009

Maybe add a direct message functionality like Fordlawnmower has. Very short and clean though!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.