Twitter Stream

By FordLawnmower on Feb 14, 2010

Script was written at the request of lilibox
This script was made to post your friends timeline on a irc channel so that people who have twitter.com blocked at work can still see their updates.

While this script does accomplish this task, I designed it to have an @Twitter window that will keep track of your friends timeline so you don't have to open your browser to see their updates.

In addition, any non-command that you type in the @Twitter window will automatically update the twitter account that you added in the setup.

START HERE:

  • Go here -->> http://dev.twitter.com/apps/new
  • Fill in all the boxes
  • Application Name: Will Posted after each tweet (ie via Application Name)
  • Description: Anything you want here.
  • Application Website: Will be linked to the application name in each tweet. (spam your website here)
  • Anything you want here. Only shows on the apps page.
  • Application Type: Click "Client".
  • Default Access type: Click "Read & Write".
  • Application Icon: You can skip this for now.
  • Enter the Captcha
  • Click "Register Application"

Now you have registered your first app :)
You can always go to http://dev.twitter.com/apps/ and see your apps.

Image

Now you just need to get the keys and secrets and put them in the script:

  • Download and install OpenSSL: http://www.mirc.com/download/openssl/openssl-0.9.8r-setup.exe
  • Copy the code from this page and paste it to a new remote in the mIRC script editor. (keep this window open)
  • Click on your application (if needed)
  • Scroll down to Consumer key
  • Copy the key and paste it over top of "PutYourConsumerKeyHere" in the consumer_key alias at the top of the mIRC script.
  • Scroll to Consumer secret
  • Copy and paste it over "PutYourConsumerSecretHere" in the consumer_secret alias.
  • Now - On the right pane of your applications page - Click "My Access Token"
  • Copy the token under "Access Token (oauth_token)" and paste it over "PutYourOauthTokenHere" in the oauth_token alias.
  • Copy the token under "Access Token Secret (oauth_token_secret)" over "PutYourOauthTokenSecretHere" in the oauth_token_secret alias.
  • Replace @PutYourTwitterScreenNameHere with your @screenname. Don't leave out the "@"
  • Save the script with a unique filename and you are ready to Start :)
  • Right click Channel or Status, Scroll to "Twitter Stream" and turn the script ON.

**All Done. @Twitter will open in about 60 seconds :)
On first use you will have to accept twitters ssl certificate.
Make sure you check the box to "Automatically accept this certificate in the future".

Image

Advanced Options:
You can change the delay from setup but the minimum is 60 seconds.
You can change the output from @Twitter to echo -at
**You can change the output to a #channel.(Make sure you open the menu from the network the #channel is in to change this setting.)

Example Output:
Image

Updated
Changed Edit box from Single line to Multi-Line.
Added a Window to show your @Name highlights.
Added Support for Re-tweets. Double Click [RT] To re-tweet.
Added Double click to Shout. Just Double click a name and it will add @Name to the start of the edit box.
Updated
Added MyTwitterScreenName alias.
Updated script for api 1.1
**Updated for ssl

;Twitter Channel by Ford_Lawnmower irc.GeekShed.net #Script-Help
;;;;;;;;;;;;;;;;;
;::Start Setup::;
;;;;;;;;;;;;;;;;;
;Edit the lines below to reflect your Twitter Application info.
alias -l consumer_key return PutYourConsumerKeyHere
alias -l consumer_secret return PutYourConsumerSecretHere
alias -l oauth_token return PutYourOauthTokenHere
alias -l oauth_token_secret return PutYourOauthTokenSecretHere
alias -l MyTwitterScreenName return @PutYourTwitterScreenNameHere
;;;;;;;;;;;;;;;
;::End Setup::;
;;;;;;;;;;;;;;;
menu * {
  .Twitter Stream
  ..$iif($timer(mIRCTwitter),Off,On): { 
    if ($timer(mIRCTwitter)) { 
      .timermIRCTwitter off
      hadd -m mIRCTwitter Status 0 
    }
    else {
      mIRCTwitter
      .timermIRCTwitter -o 0 $iif($hget(mIRCTwitter,Delay),$hget(mIRCTwitter,Delay),60) mIRCTwitter
      hadd -m mIRCTwitter Status 1
    }
  }
  ..SetUp
  ...Set Delay:hadd -m mIRCTwitter Delay $iif($$?="Enter Delay in Seconds" > 59,$!,60) | mtsave
  ...Set Method of Output
  ....Bot Message(.msg #Channel):hadd mIRCTwitter Method $network .msg $$?="Enter the Channel Name including the #prefix" | mtsave
  ....Message(msg #Channel):hadd mIRCTwitter Method $network msg $$?="Enter the Channel Name including the #prefix" | mtsave
  ....Echo(Echo -at):hadd mIRCTwitter Method echo -at | mtsave
  ....Window(Echo -t @Twitter):hadd mIRCTwitter Method echo -t @Twitter | mtsave
}
alias -l mIRCTwitter mTwitterGetStatus echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret
alias mIRCTweet mTwitterUpdate echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret $1-
;Syntax mTwitterUpdate 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 mTwitterUpdate {
  var %ots $ctime, %sockname mTwitterUpdate, %once $md5(%sockname)
  var %os $signature(post,https://api.twitter.com/1.1/statuses/update.json,$3,$4,$5,$6,%once,%ots,$+(status=,$tuenc($7-)))
  .sockclose %sockname
  sockopen -e %sockname api.twitter.com 443
  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:mTwitterUpdate: {
  if ($sockerr) echo -st Socket Error $nopath($script)
  else {
    tokenize 32 $sock($sockname).mark
    sockwrite -n $sockname POST /1.1/statuses/update.json 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.1/statuses/update.json", $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
  }
}
on *:sockread:mTwitterUpdate: {
  if ($sockerr) { $gettok($sock($sockname).mark,1-2,32) Unknown Socket error $nopath($script) }
  else {
    var %mTwitterUpdatevar | sockread %mTwitterUpdatevar
    if (HTTP/1.1 401 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Password/Username Error --> %mTwitterUpdatevar
      sockclose $sockname | return
    }
    elseif (HTTP/1.1 502 isin %mTwitterUpdatevar) || (HTTP/1.1 503 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Server Busy Error --> %mTwitterUpdatevar
      sockclose $sockname | return
    }
    elseif (HTTP/1.1 500 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Server Side Error --> %mTwitterUpdatevar
      sockclose $sockname | return      
    }
    elseif (HTTP/1.1 403 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Connection Actively Refused --> %mTwitterUpdatevar
      sockclose $sockname | return      
    }
    elseif (HTTP/1.1 400 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Unknown Error --> %mTwitterUpdatevar
      sockclose $sockname | return
    }
    elseif (HTTP/1.1 200 isin %mTwitterUpdatevar) {
      $gettok($sock($sockname).mark,1-2,32) Updating Status Please Wait.........
    }
    elseif (status: 200 OK isin %mTwitterUpdatevar) {
      .timer 1 3 $gettok($sock($sockname).mark,1-2,32) Your Status has been updated :)
      sockclose $sockname | return
    }
  }
}
alias -l mTwitterGetStatus {
  var %ots $ctime, %sockname mTwitterGetStatus, %once $md5(%sockname), %sinceid $iif($hget(mirctwitter,last_id),$v1,1)
  var %os $signature(GET,https://api.twitter.com/1.1/statuses/home_timeline.json,$3,$4,$5,$6,%once,%ots,$+(since_id=,%sinceid))
  .sockclose %sockname
  sockopen -e %sockname api.twitter.com 443
  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 $+(since_id=,%sinceid)) 1 1
}
on *:sockopen:mTwitterGetStatus: {
  if ($sockerr) echo -st Socket Error $nopath($script)
  else {
    .remove $sockname
    tokenize 32 $sock($sockname).mark
    sockwrite -n $sockname GET /1.1/statuses/home_timeline.json? $+ $+(since_id=,$iif($hget(mirctwitter,last_id),$v1,1)) 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.1/statuses/home_timeline.json", $3
    sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
    sockwrite -n $sockname Connection: close
    sockwrite -n $sockname $crlf
  }
}
On *:sockread:mTwitterGetStatus: {
  if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  else {
    sockread -f &getstatus
    var %mTwitterGetStatus $bvar(&getstatus,1-).text
    write -n $sockname %mTwitterGetStatus
  }
}
On *:sockclose:mTwitterGetStatus: {
  bread $sockname 0 $file($sockname).size &mTwitterGetStatus
  var %mcount 1
  while ($bintween(&mTwitterGetStatus,{"created_at":,"source":,%mcount)) {
    var %tweetinfo $v1, %userinfo $bintween(&mTwitterGetStatus,"user":{,"location":,%mcount)
    noop $regex(%tweetinfo,/"id_str":"(.*?)"\x2c"text":"(.*)"/i)
    if (!$hget(mirctwitter,Last_ID)) hadd mirctwitter Last_ID 1
    if ($regml(1) > $hget(mirctwitter,Last_ID)) { hadd -m mirctwitter Last_ID $regml(1) }
    var %id $regml(1), %tweet $regml(2)
    noop $regex(%userinfo,/"screen_name":"(.*)"/i)
    var %screenname $regml(1)
    inc %mcount
    var %Method $hget(mIRCTwitter,Method)
    if (%Method == echo -at) { %Method $fix&#($+(09<07,%screenname,09>04) %tweet) }
    elseif ($me ison $gettok(%Method,3,32)) {
      .timer 1 $gettok($sock($sockname).mark,5,32) $gettok(%Method,2-,32) $fix&#($+(09<07,%screenname,09>04) %tweet)
    }
    else {
      if (!$window(@Twitter)) { window -E @Twitter }
      var %NextTweet $fix&#($+(09<07,%screenname,09>04) %tweet) 02,08[04RT02]
      aline -p @Twitter $timestamp %NextTweet
      if ($istok(%NextTweet,$MyTwitterScreenName,32)) {
        if (!$window($MyTwitterScreenName)) { window -E $MyTwitterScreenName }
        aline -p $MyTwitterScreenName $timestamp %NextTweet
        noop $tip(%screenname,Twitter $MyTwitterScreenName,%NextTweet,60,,,,)
      }
    }
  }
  .remove $sockname
}
alias -l bintween {
  var %mcount = 1, %mark = 0, %mark2 = 0
  while (%mcount <= $4) {
    if ($bfind($1, %mark2, $2).text) {
      %mark = $calc($bfind($1, %mark2, $2).text + $len($2))
      if ($bfind($1, %mark, $3).text) {
        %mark2 = $bfind($1, %mark, $3).text
      }
      else { return 0 } 
    }
    else { return 0 }
    inc %mcount
  }
  return $bvar($1, $iif(%mark > 0,%mark,1), $calc(%mark2 - %mark)).text
}
;Syntax $signature(POST/GET,URL,consumer_key,consumer_secret,oauth_token,oauth_token_secret,oauth_nonce,oauth_timestamp,PostData)
alias -l signature {
  var %method $+($upper($1),&), %url $+($tuenc($2),&), %ck $tuenc&($+(oauth_consumer_key=,$3)), %ot $tuenc&($+(oauth_token=,$5))
  var %once $tuenc&($+(oauth_nonce=,$7)), %ots $tuenc&($+(oauth_timestamp=,$8)), %post $iif($9-,$tuenc($+(&,$9-)))
  return $hmacsha1($+($4,&,$iif($6,$6)),$+(%method,%url,%ck,%once,$tuenc&($osm),%ots,%ot,$tuenc($over),%post))
}
alias -l osm return oauth_signature_method=HMAC-SHA1
alias -l osmqt return oauth_signature_method="HMAC-SHA1"
alias -l over return oauth_version=1.0
alias -l overqt return oauth_version="1.0"
alias -l tuenc return $regsubex($replace($1-,+,$chr(32)),/([^a-z0-9._-])/ig,% $+ $base($asc(\t),10,16,2))
alias -l suenc return $regsubex($1-,/([^a-z0-9._-])/ig,% $+ $base($asc(\t),10,16,2))
alias -l space2comma return $replace($1-,$chr(32),$chr(44))
alias -l tuenc& return $tuenc($+($1,&))
;hmacsha1 by Ford_Lawnmower irc.GeekShed.net #Script-Help
;Syntax hmacsha1 key message or $hmacsha1(key,message)
alias -l hmacsha1 {
  var %key $1, %data $2
  bset -c &key 1 $regsubex(%key,/(.)/g, $asc(\1) $chr(32))
  bset -c &data 1 $regsubex(%data,/(.)/g, $asc(\1) $chr(32))
  if ($bvar(&key,0) > 64) bset -c &key 1 $hex2chr($sha1(&key,1))
  bset -c &ipad 1 $xorall($str($+(54,$chr(32)),64),$bvar(&key,1-))
  bset -c &opad 1 $xorall($str($+(92,$chr(32)),64),$bvar(&key,1-))
  bcopy &ipad $calc($bvar(&ipad,0) + 1) &data 1 -1
  bset -c &ipad 1 $hex2chr($sha1(&ipad,1))
  bcopy &opad $calc($bvar(&opad,0) + 1) &ipad 1 -1
  bset -c &return 1 $hex2chr($sha1(&opad,1))
  noop $encode(&return, mb)
  $iif($isid,return,$iif(#,say,echo -a)) $bvar(&return, 1-).text
}
alias -l hex2chr return $regsubex($1-,/(.{2})/g, $base(\t,16,10) $chr(32))
alias -l xorall {
  var %p $1, %k $2, %end $iif($regex($1,/([\d]{1,})/g) > $regex($2,/([\d]{1,})/g),$v1,$v2)
  return $regsubex($str(.,%end),/(.)/g,$+($xor($iif($gettok(%p,\n,32),$v1,0),$iif($gettok(%k,\n,32),$v1,0)),$chr(32)))
}
On *:input:$($+($MyTwitterScreenName,$chr(44),@Twitter)): {
  if ($left($1,1) != /) {
    haltdef 
    echo -t $active $+(07<09,$mid($MyTwitterScreenName,2-),07>09) $1-
    mIRCTweet $1-
  }
}
alias -l fix&# {
  return $regsubex($regsubex($replace($regsubex($regsubex($1-,/\\u[a-f0-9]{4}/g,$H2U(\t)),/(\\)(?!\\)/g,$null),&quot;,",&amp;,&,&gt;,>,&lt;,<),/\&#(\d+);/g,$UTF8(\t)),$&
    /([$\|%\[\]\}\{][^\s]*)/g,$+($chr(2),$chr(2),\t))
}
alias -l UTF8 {
  if ($version >= 7) return $chr($1)
  elseif ($1 < 255) { return $chr($1) }
  elseif ($1 >= 256) && ($1 < 2048) { return $+($chr($calc(192 + $div($1,64))),$chr($calc(128 + $mod($1,64)))) }
  elseif ($1 >= 2048) && ($1 < 65536) { return $+($chr($calc(224 + $div($1,4096))),$chr($calc(128 + $mod($div($1,64),64))),$chr($calc(128 + $mod($1,64)))) }
  elseif ($1 >= 65536) && ($1 < 2097152) {
    return $+($chr($calc(240 + $div($1,262144))),$chr($calc(128 + $mod($div($1,4096),64))),$chr($calc(128 + $mod($div($1,64),64))),$&
      $chr($calc(128 + $mod($1,64))))
  }
}
alias -l div { return $int($calc($1 / $2)) }
alias -l mod {
  var %int $int($calc($1 / $2))
  return $calc($1 - (%int * $2))
}
alias -l H2U { return $utf8($base($1,16,10)) }
alias -l mtsave {
  if ($hget(mIRCTwitter,Status)) {
    .timermIRCTwitter -o 0 $iif($hget(mIRCTwitter,Delay),$hget(mIRCTwitter,Delay),60) mIRCTwitter
  }
  if ($hget(mIRCTwitter)) { hsave mIRCTwitter mIRCTwitter.hsh }
}
on ^$*:HOTLINK:/^<([^<>]*)>/S:$($+($MyTwitterScreenName,$chr(44),@Twitter)):{
  if ($1) { return }
  halt
}
on ^$*:HOTLINK:/^\[RT\]/S:$($+($MyTwitterScreenName,$chr(44),@Twitter)):{
  if ($1) { return }
  halt
}
on $*:HOTLINK:/^<([^<>]*)>/S:$($+($MyTwitterScreenName,$chr(44),@Twitter)):{
  if ($mouse.key) { editbox $active $+(@,$strip($regml(1))) }
  halt
}
on $*:HOTLINK:/^\[RT\]/S:$($+($MyTwitterScreenName,$chr(44),@Twitter)):{
  if ($mouse.key) {
    noop $regex($hotline,/<([^<>]*)>(.*)\[RT\]/S)
    editbox $active RT $strip($+(@,$regml(1)) $regml(2)) 
  }
  halt
}
On *:Start: {
  hmake mIRCTwitter 1
  if ($isfile(mIRCTwitter.hsh)) { hload mIRCTwitter mIRCTwitter.hsh | mtsave }
}
On *:Unload: {
  if ($hget(mIRCTwitter)) { hfree mIRCTwitter }
  if ($isfile(mIRCTwitter.hsh)) { .remove mIRCTwitter.hsh }
}

Comments

Sign in to comment.
SquigY0   -  Aug 17, 2017

Now, on my two PCs that this script previously worked on, and on a friend's that was running this successfully, it never seems to take the login credentials. Trying to Tweet it asks for the credentials even though you just entered them using //say. If you enter the authorization without //say, it says it's downloading, then says it's forbidden and still asks for credentials again on the next Tweet try.

Anybody have a solution?

 Respond  
Bri1977   -  Nov 08, 2014

This script works perfectly for me

FordLawnmower  -  Nov 08, 2014

Thanks Bri1977. It's good to see someone still getting some use out of this script.

Bri1977  -  Nov 14, 2014

hmm lol it does have one issue, which can get a little annoying lol every time she restarts her mIRC it posts the last message back to IRC
[10:01:55] 09 hellllllllllow you got a problem to solve
[18:39:23] 09 hellllllllllow you got a problem to solve

there is probably a quick fix to this or a little tweak, i had a quick look, but i cant see anything in the script, so i am hoping you know why it keeps posting that message and a way to fix it lol

Sign in to comment

Sphincone   -  Mar 31, 2014

Great script. But I can't use. :S

I tried using via IRCHighWay. Or which server should I use for this script? Well, when using via IRCHighway, I get this error
Invalid parameters: $bfind (line 158, Twitter)

 Respond  
anviska   -  Mar 15, 2014

Hi. Looks like a great script. I just seem to have this problem after setting all up and turning the script on. I get this warning "* /bread: insufficient parameters (line 121, twitter.mrc)" and the ssl connection does not open, I guess it's because of that error. What am I doing wrong? Thanks!

anviska  -  Mar 15, 2014

A little update: It's working now! But I still do get that error. Do you know what's it about?

FordLawnmower  -  Mar 15, 2014

@anviska I'm guessing your error is coming from line 126 and you have removed the credits from the top of the script.

bread $sockname 0 $file($sockname).size &mTwitterGetStatus

If this is the case, the problem might not be in the script, but rather your machine not keeping up with the script.
Since this error is occurring inside the on sockclose event, the file $sockname has already been written.
This error is being triggered because $file($sockname).size is returning $null (In other words, the file doesn't exist.

It's my guess that your machine may be delaying file writes for some reason, causing the file to still be unwritten after the script has already told your machine to write it.
Possible causes: Under powered machine being asked to do too much | Slow ide hard drive | mIRC is set at too low of a priority.
I've never seen this error or had it reported, so this is just a guess based on the knowledge of how the script works.
Solutions:
Change the priority of mIRC : http://www.wikihow.com/Change-Process-Priorities-in-Windows-Task-Manager
Change the on sockclose event to this:

On *:sockclose:mTwitterGetStatus: {
  if ($file($sockname).size) {
    bread $sockname 0 $file($sockname).size &mTwitterGetStatus
    var %mcount 1
    while ($bintween(&mTwitterGetStatus,{"created_at":,"source":,%mcount)) {
      var %tweetinfo $v1, %userinfo $bintween(&mTwitterGetStatus,"user":{,"location":,%mcount)
      noop $regex(%tweetinfo,/"id_str":"(.*?)"\x2c"text":"(.*)"/i)
      if (!$hget(mirctwitter,Last_ID)) hadd mirctwitter Last_ID 1
      if ($regml(1) > $hget(mirctwitter,Last_ID)) { hadd -m mirctwitter Last_ID $regml(1) }
      var %id $regml(1), %tweet $regml(2)
      noop $regex(%userinfo,/"screen_name":"(.*)"/i)
      var %screenname $regml(1)
      inc %mcount
      var %Method $hget(mIRCTwitter,Method)
      if (%Method == echo -at) { %Method $fix&#($+(09<07,%screenname,09>04) %tweet) }
      elseif ($me ison $gettok(%Method,3,32)) {
        .timer 1 $gettok($sock($sockname).mark,5,32) $gettok(%Method,2-,32) $fix&#($+(09<07,%screenname,09>04) %tweet)
      }
      else {
        if (!$window(@Twitter)) { window -E @Twitter }
        var %NextTweet $fix&#($+(09<07,%screenname,09>04) %tweet) 02,08[04RT02]
        aline -p @Twitter $timestamp %NextTweet
        if ($istok(%NextTweet,$MyTwitterScreenName,32)) {
          if (!$window($MyTwitterScreenName)) { window -E $MyTwitterScreenName }
          aline -p $MyTwitterScreenName $timestamp %NextTweet
          noop $tip(%screenname,Twitter $MyTwitterScreenName,%NextTweet,60,,,,)
        }
      }
    }
    .remove $sockname
  }
}

note The on sockclose event starts at line 125 and ends at line 154
This assumes that the script is intact an the credits have not been removed.

anviska  -  Mar 15, 2014

Sorry! I'm so noob at these things. I wasn't sure if the first lines were part of the script so I didn't copy/paste them. If they do no harm, I'll put them right back. Thank you for your quick reply. I'll try your advices.

FordLawnmower  -  Mar 15, 2014

No worries @anviska . It just makes it easier to point to the correct line when editing.
If everyone's line one is different, then it's hard to have a discussion and understand each other.

anviska  -  Mar 15, 2014

@FordLawnmower it works perfectly now! thanks again.

anviska  -  Mar 16, 2014

@FordLawnmower sorry to bother you again. The channel I'm using in Quakenet has +r from time to time. This means no colours are allowed which means the tweets are not shown either. Is there any way I could drop the colour codes from the tweets?

Sign in to comment

gigibecali123   -  Jan 14, 2014

Script stopped working today for me, I think it might have something to do with this update for the twitter api https://dev.twitter.com/discussions/24239

 -  Jan 15, 2014

Yep they are now requiring HTTPS. error in script is "Connection Actively Refused --> HTTP/1.1 403 Forbidden"
:(

FordLawnmower  -  Jan 15, 2014

This script is now updated and working, but you must have ssl installed for it to work.
To check if ssl is already running.
Type:

//echo -a $sslready

If this returns : $true
Then you are ready to go.
If not Download and install OpenSSL: http://www.mirc.com/download/openssl/openssl-0.9.8r-setup.exe

On first use you will have to accept twitters ssl certificate.
Make sure you check the box to "Automatically accept this certificate in the future".
Image

 -  Jan 15, 2014

works well. thanks for the quick fix!

Sign in to comment

  -  Oct 12, 2013

Is there anyway to make it display more than 20 tweets at a time?
thanks

 Respond  
TomBobBlender   -  Jul 13, 2013

Whenever I receive a mention, it continuously repeats said tweet in my @Screenname status window, as well as a "$tip (line 148)" error in the IRC status window. It also halts regular tweets from coming through. Any ideas?

FordLawnmower  -  Jul 13, 2013

@TomBobBlender It would help to see the whole error. Can you post it please.

TomBobBlender  -  Jul 13, 2013

the whole error is through a status window - * Invalid parameters: $tip (line 148, Twitter.mrc)

FordLawnmower  -  Jul 13, 2013

@TomBobBlender It was a bug. Fixed now.
Updated

TomBobBlender  -  Jul 14, 2013

It now imports my tweets down (not the @Mentions) to the Example Output window and seems to continuously loop the importing, causing mIRC to crash or needing to press the break key to halt the script.

FordLawnmower  -  Jul 14, 2013

@TomBobBlender First off. What is the "Example Output window" ? What do you mean by imports ?
What this script does is gets your timeline and displays it to the @Twitter window. If one of the tweets contains your screenname, as defined by the alias at the top of the script, it will be displayed in the @Myscreenname window. This script does not get your @mentions.
Please take some time and describe your problem so I can understand it. Not what it seems to do, but what you actually see. Screenshots would be helpful. Also please post your mIRC version and any other information that might be relevant.

TomBobBlender  -  Jul 14, 2013

the 'Example Output' window I was referring to was the window listed in your tutorial (@Twitter window). This is where the timeline (I referred then as imports) comes through. This window loops tweets, causing mIRC to crash. I'm using mIRC 7.32 - Image: http://imgur.com/jt8QFHn - also in the @Myscreenname window: http://i.imgur.com/dP40jG3.png - Observation: the first tweet in both windows are the same. If the script is turned off then on again, the same timeline comes through.

FordLawnmower  -  Jul 14, 2013

Do you have any errors in status ? Do you have any scripts loaded that could conflict with this one ? ie. another script that uses twitters api.
Is this script in a remote by it's self (With no other code) ?
Can you try loading the script to a clean mIRC and see if you still have a problem ?
Can you pls type /timers and paste the result back here ?
Can you try setting your delay to 90 seconds or more ?
I have tested this script with 7.32 with no issues.

TomBobBlender  -  Jul 14, 2013

There are no errors in the status window. I had many scripts loaded, but none of them would make use of Twitter's API for sure. To make sure, I loaded this script without any other scripts loaded (and restarted mIRC) and the problem continued. - http://imgur.com/bfS0xN4 I did, however, try launching a clean mIRC in a virtual machine and it ran perfectly fine. - http://imgur.com/LNXARaj

FordLawnmower  -  Jul 14, 2013

@TomBobBlender I don't see any problems in those screen shots. Do you see a problem in the screenshot ?
What is your windows version ?

TomBobBlender  -  Jul 14, 2013

Windows 7 Home Premium. Very odd. I've been using your script for a few months with no problems. This only started happening once the script was updated with Twitter's new API. I can't seem to figure out what could be bothering it. The virtual machine is running XP.

FordLawnmower  -  Jul 14, 2013

@TomBobBlender I have this running with win 7 and mIRC 7.32 with no problems. I'm guessing that their could be a conflict with a global variable in another script. So , in theory, the other script would keep changing the variable causing a loop.
I made some small changes to the code and made some of the local variables more descriptive.
Please try the updated code and let me know if there is any change.
Make sure you unload the script with the /unload command (/unload -rs scriptname.mrc) or unload it from the file menu in the scripts editor. This will remove the old hashtable and delete the old .hsh file.
Alternately you could type : //hfree -s mirctwitter | remove mirctwitter.hsh
After you have unloaded or ran the command , then try the new code.

TomBobBlender  -  Jul 14, 2013

I followed all of your steps, and the situation remains unchanged.

FordLawnmower  -  Jul 14, 2013

Sorry @TomBobBlender , If I can't reproduce the error then I can't help.
Just guessing at it is a waste of time. I'm really not even sure what problem you are having.
I have this script running with zero issues on win 7 with mIRC 7.32.
If there is some information that you can add to this discussion that will help me understand what the problem is, please post it.
I'm out of guesses.
The last screenshots you posted looked totally normal. Do you see something wrong with them ??

TomBobBlender  -  Jul 14, 2013

this is the last thing I can think of doing - http://screencast-o-matic.com/watch/cIioVNVaqM - I'm not sure if this will be helpful to you or not, but it's worth a shot.

FordLawnmower  -  Jul 14, 2013

@TomBobBlender That helps explain the situation. The temp file that is made to read the page might have gotten huge when you were getting $tip errors. So it seems to be looping but it's actually just trying to read a monster file that should have been deleted by the script.
I've updated to code to remove the file each time the socket opens successfully.
Please try the updated code an let me know if this resolves your issues.

TomBobBlender  -  Jul 14, 2013

All issues have been resolved. Thank you for all of your amazing help and patience. I truly appreciate it. :o)

FordLawnmower  -  Jul 14, 2013

@TomBobBlender Your welcome and thank you for hanging in there with me :)

Sign in to comment

RicJames   -  Jun 23, 2013

This is double posting again. Also not sure if it's been designed this way or not, but when it's pulling an update from twitter to display to the channel it displays the newest first than the oldest. So for example if USERA posted " Hi how are you" and USERB retweeted it, it would show USERB's message first followed by USERA. Not a big deal but just wanted to make sure it's not a glitch.

FordLawnmower  -  Jul 09, 2013

@RicJames Updated

NitrogenUA  -  Jul 16, 2015

to add to this one. it keeps posting the original tweets of people i'm NOT following once retweeted by the people i do follow. like this http://imgur.com/pw7XsOu - so retweet then original tweet and so on. (ignore the double timestamps)
can i have only the tweets of the people i'm following?

Sign in to comment

FordLawnmower   -  Jun 07, 2013

Updated
You will now have to edit in your screenname to the MyTwitterScreenName alias, due to Twitters removal of all rss, atom and xml pages.
Api 1.1 only supports json, which has no title.
The maximum refresh rate can no longer be lower than 60 seconds, as api 1.1 has a hard limit of 60 requests per method, per hour.
Thanks @ for the reminders.

RicJames  -  Jun 12, 2013

Not working for me I keep getting " MIRCTWITTER Unknown command " Error.

FordLawnmower  -  Jun 12, 2013

@RicJames The mIRCTwitter alias is local because it is only called by the script, however, you may try removing the -l from the alias.
Change line 35 from :

alias -l mIRCTwitter mTwitterGetStatus echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret

To:

alias mIRCTwitter mTwitterGetStatus echo -a $consumer_key $consumer_secret $oauth_token $oauth_token_secret
RicJames  -  Jun 13, 2013

The error in the status window has stopped but the script still refuses to work :/

RicJames  -  Jun 14, 2013

I have tried running this in 3 different clients including two that have nothing else loaded, and two different networks, but for some reason no matter what I do I can't get it to work :/

FordLawnmower  -  Jun 14, 2013

@RicJames You need to review your application settings and make sure you set them to "client" and "read write"
You also need to check your key, secret, token and token secret to make sure you have put them in the right place.
If you are still having trouble , come to irc.geekshed.net #Script-Help and I will test your tokens for you to make sure you have your twitter application set up right.

Sign in to comment

TomBobBlender   -  Nov 04, 2012

@FordLawnmower I very much look forward to that!

 Respond  
FordLawnmower   -  Nov 04, 2012

@TomBobBlender This script just monitors your timeline for @mentions .
Making a separate query to monitor your global mentions would be a different script all together.
I will consider making a script for that, but it will probably not be part of this one.

 Respond  
TomBobBlender   -  Nov 04, 2012

@FordLawnmower is it possible for messages who mention you to show up in your status window? It seems only people who I currently follow allow that to happen.

 Respond  
RicJames   -  Oct 31, 2012

@FordLawnmower Just wondering if it would be possible to have a link after each tweet, so that you can click it and view it in your browser?

 Respond  
RicJames   -  Oct 29, 2012

Awesome, Thanks so much FordLawnmower

 Respond  
FordLawnmower   -  Oct 27, 2012

@RicJames Just updated.
I fixed this a couple of weeks ago, but I guess I forgot to update it here. Sorry.

 Respond  
RicJames   -  Oct 26, 2012

Hi this snippet has stopped working, I was wondering if you could please take a look at it @FordLawnmower

 Respond  
FordLawnmower   -  Jun 18, 2011

@Aha2Y that isn't a bug. It's a custom error. This usually means that twitters api is temporarily down or overloaded.
It's nothing to worry about. You will get it from time to time.

 Respond  
Jordyk19   -  Jun 18, 2011

Looks like there is some bug now, it worked fine untill i got this error

Socket Error Twitter Stream.ini

 Respond  
BDND   -  Jun 13, 2011

I placed the script in remote, and try to start it. but get the following error when i click "ON"
Invalid format: $signature (line 97,

 Respond  
FordLawnmower   -  May 30, 2011

You're welcome Amiga600 :)
Sorry it took me so long to get this back up and running.

 Respond  
Amiga600   -  May 30, 2011

Thanks very much FordLawnmower for making this script, It's massively useful, along with the !tweet script you put up, to create a fully-functional Twitter Bot. Words cant comprehend how happy I am right now having full twitter functionality via IRC.

 Respond  
FordLawnmower   -  May 28, 2011

This script is updated and working again using the Oauth Single token method. Please see the introduction at the top of this page for proper setup.
Please post any problems or issues here.

 Respond  
GTAXL   -  Feb 03, 2011

Error!! No UserName:Password Data. Please return to the menu and setup the script properly
Incorrect UserName:Password Combination!! Please Try Again with the Correct Information.

I've put in the correct username and password.. I really want this to work. Possibly be able to msg channels updates from lists. Like List Alerts I can set to msg #Alerts and Friends I can set to #Twitter and it'll show all tweets. :P

 Respond  
FordLawnmower   -  Dec 05, 2010

@SquigY0 Nope Currently I only have this update script working -->> http://www.hawkee.com/snippet/7945/
I'm going to modify this one to use the single token update method but I haven't got to it yet ;/

 Respond  
SquigY0   -  Dec 05, 2010

Any updates to this script? Regardless of the username and password I try when entering the information into the initial setup menu, I get "Incorrect UserName:Password Combination" in my MIRC window. I try the passwords on the Twitter site itself and it lets me in so it's not a matter of not knowing the passwords.

 Respond  
Amiga600   -  Aug 17, 2010

Ah ok, It was only a suggestion anyways, the hashtag thing would be good, dont you think, so people could just click the link and travel there.

Currently the #hashtags in IRC serve as a channel name, so clicking it would take you to the channel name it states.

I've just figured this out, I've done it like follows:
var %lasttweet $replace(%lasttweet,$chr(35),http://www.twitter.com/search?q= $+ $chr(35) $+ )

It does work well, I've added it into that section you posted %lasttweet :)

 Respond  
FordLawnmower   -  Aug 16, 2010

I must have missed your previous comment Amiga600. It is possible to change what it says after the post if you have an api key and you get your project approved by twitter. At this point it will say the name of your project after the post.
The problem that I ran into here is that twitter will not approve the project if you are using basic auth. Twitter insists that you use Oauth, which I have considered for some of my scripts but I always run into more problems at this point.
I won't get into all the issues that I have with OAuth, but I will say that my main problem is that I would have to post my personal api key for others to use my project name. Given the high probability of abuse if you post your personal key on a public forum like this, I haven't put much more thought into these changes.
At some point I will have to switch to OAuth and I will probably wait to change the script.

hashtag I don't really know much about twitter ;/

That looks like it just searches for other instances of that #words use in a tweet.
Is it really necessary to create a link for this.
idk I'm out of the loop or something.

 Respond  
Amiga600   -  Aug 16, 2010

FordLawnmower, Any chance of converting the Hashtag links into a clickable link?

for example: #hashtag
http://twitter.com/search?q=%23hashtag

also please can you confirm/deny my previous message, Thanks dude :)

 Respond  
FordLawnmower   -  Jul 09, 2010

I agree with you ivan667. Lists would be a powerful edition to this script but I will have to find some time to make these changes.
As for the multi-line edit box at the bottom of the @twitter window, I asked over a hundred people if their edit box would hold 140 characters and about 40% said no. The issue isn't that their screen is too small. It's just that many people don't use mIRC in full screen, but rather in a cascaded style with multiple windows on the screen.
If you want the single line editbox , just do a find and replace on the script:
Find:

window -E

Replace with:

window -e
 Respond  
ivan667   -  Jul 09, 2010

Hi. This script is good, however it's only useful to me if I can get tweets from a personal twitter list. My home feed is pretty much useless to me. I'm a blogger and I follow hundreds of people. The people I really care to follow are on a list.

So PLEASE consider adding a way to add support for twitter lists! It would be kinda neat to allow a way to have multiple windows as well, for people who want to have a window for their home feed and a twitter list, or just multiple twitter lists (that's how I'd set it up!)

Also, the bar at the bottom to send the tweets is too big. One line is enough. Unless you use a really small window, 140 characters fit on one line. Maybe you could make it so it resizes somehow?

I'll keep an eye on this page for a reply or an update... Please make this happen :)

 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.