Here is my version. Not using sockets stuff.
I just wrote it and not enough testing yet.
You can expand from there. Using timer or something else. Just make sure you dont flood twitch api wink

Usage:
/follow #channel
or type !followers (in the channel)

Note:
- need $json snippet.
- !followers is OP command.
Code:
on *:TEXT:!followers:#:if $nick isop # { follow # }

alias follow {
  var %chan $1, %username $iif($left($1,1) == $chr(35),$right($1,-1),$1)
  var %cmd $iif(%chan ischan,msg %chan,echo -agt)
  if !$readini(follower.ini,%username,$chr(44)) {
    %cmd start follower update for %chan $+ ...
    follow@ %chan %username
  }
  else { %cmd follower update for %chan is in progress.. }
}

alias -l follow@ {
  var %chan $1, %username $2, %follow 
  tokenize 32 $readini(follower.ini,%username,$chr(44))
  var %limit 100, %offset $iif($1,$1,0), %ctime $iif($2,$2,$ctime)
  var %lastshow $iif(!$ini(follower.ini,%username),10)
  var %url $+(https://api.twitch.tv/kraken/channels/,%username,/follows?limit=,%limit,&offset=,%offset)

  echo -agt parsing.. %url | ; if you dont want to see update progress, delete this line.

  var %i 0 | while $json(%url,follows,%i,user,display_name) {
    var %f $v1 | inc %i
    if ($numtok(%follow,32) <= %lastshow || (!%lastshow && !$readini(follower.ini,%username,%f))) && %offset == 0 { %follow = %follow %f }
    writeini follower.ini %username %f %ctime
  }
  var %cmd $iif(%chan ischan,msg %chan,echo -agt)
  if %offset == 0 {
    if %follow { %cmd Welcome to our new followers: $replace(%follow,$chr(32),$+($chr(44),$chr(32))) }
    else { %cmd There is no new followers }
  }

  if %i == %limit { 
    inc %offset %limit 
    writeini follower.ini %username $chr(44) %offset %ctime 
    .timerfollow. [ $+ [ %chan ] ] 1 5 follow@ %chan %username
  }
  else { 
    var %tmp $+(%username,.tmp)
    remini follower.ini %username $chr(44)
    hmake %username | hload -i %username follower.ini %username | hsave -i %username %tmp
    window -h @.
    filter -fwx %tmp @. $+(*,%ctime,*) 
    filter -cww @. @. *=*
    var %unfollow, %i 1 
    while $line(@.,%i) {
      %unfollow = %unfollow $v1
      remini follower.ini %username $v1
      inc %i
    }
    window -c @.
    hfree %username | .remove %tmp

    if %unfollow { %cmd Goodbye to our followers: $replace(%unfollow,$chr(32),$+($chr(44),$chr(32))) }
    echo -agt follower update for %chan is completed ( $ini(follower.ini,%username,0) users ) 
  }
}

Last edited by blessing; 05/06/14 08:16 AM.