GrimReaper commented on a Page, Twitter Directory (With Twitter Stats)  -  Dec 02, 2009

The socket to get the info is incorrect.

alias twit {
  if (!$sock(twitterstats)) {
    sockopen twitterstats twitter.com 80
    sockmark twitterstats $chan $1
  }
}

on *:sockopen:twitterstats: {
  sockwrite -nt $sockname GET / $+ $gettok($sock(twitterstats).mark,2,32) HTTP/1.0
  sockwrite -nt $sockname Host: twitter.com $+ $crlf $+ $crlf
}
on *:sockread:twitterstats: {
  sockread %twitterstats
  if (<span id="follower_count" class="stats_count numeric"> isin %twitterstats) {
    set %twitterfollowers $htmlfree(%twitterstats)
  }
  if (<span id="following_count" class="stats_count numeric"> isin %twitterstats) {
    set %twitterfollowing $htmlfree(%twitterstats)
  }
  if (<span id="lists_count" class="stats_count numeric"> isin %twitterstats) {
    set %twitterlistscount $htmlfree(%twitterstats)
  }
  if (<span id="update_count" class="stat_count"> isin %twitterstats) {
    set %twitterupdates $remove($htmlfree(%twitterstats),Tweets)
  }
}
on *:sockclose:twitterstats: {
  msg $sock(twitterstats).mark has %twitterfollowers followers, following %twitterfollowing people, They are on %twitterlistscount lists and have sent %twitterupdates updates.
}
on *:TEXT:!TwitStats *:#: {
  twit $2-
}

alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | 

return %x }

Here is an updated one that I have done. I have also added the Lists that people are in as well.

Hope thats ok with everyone. :)

 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.