- Code: Select all
menu * {
mIRC Twitter Stats:twitterstats
}
dialog twitter_stats {
title "mIRC Twitter Stats by GrimReaper"
size -1 -1 130 107
option dbu
edit "", 4, 4 4 85 10
button "Search", 5, 90 3 37 12
button "Msg Channel", 6, 4 90 37 12
button "Echo Active", 7, 46 90 37 12
button "Clear All", 8, 89 90 37 12
text "Total Followers:", 9, 4 24 38 8
text "Total Following:", 10, 4 42 38 8
text "Total Lists:", 11, 4 58 26 8
text "Total Updates:", 12, 4 74 36 8
edit "", 13, 45 23 82 10, read
edit "", 14, 45 41 82 10, read
edit "", 15, 45 57 82 10, read
edit "", 16, 45 73 82 10, read
menu "File", 1
item "Clear All", 2, 1
item "Exit", 3, 1
}
on *:DIALOG:twitter_stats:init:*: {
if (!%TwitSearchName) {
set %TwitSearchName $$?="Please enter your Twitter name:"
did -r $dname 4
did -a $dname 4 %TwitSearchName
}
else {
did -r $dname 4
did -a $dname 4 %TwitSearchName
}
}
on *:DIALOG:twitter_stats:sclick:5,6,7,8: {
if ($did == 5) {
did -r $dname 13,14,15,16
TwitSearchStats $did($dname,4).text
}
if ($did == 6) {
if (!$did($dname,13).text) || (!$did($dname,14).text) || (!$did($dname,15).text) || (!$did($dname,16).text) { noop $input(Please search for a twitter name first.,uwo,Error!) }
else {
msg $active Twitter stats for $did($dname,4).text $+ :
msg $active Total followers: $did($dname,13).text
msg $active Total following: $did($dname,14).text
msg $active Total lists: $did($dname,15).text
msg $active Total updates: $did($dname,16).text
}
}
if ($did == 7) {
if (!$did($dname,13).text) || (!$did($dname,14).text) || (!$did($dname,15).text) || (!$did($dname,16).text) { noop $input(Please search for a twitter name first.,uwo,Error!) }
else {
echo -at Twitter stats for $did($dname,4).text $+ :
echo -at Total followers: $did($dname,13).text
echo -at Total following: $did($dname,14).text
echo -at Total lists: $did($dname,15).text
echo -at Total updates: $did($dname,16).text
}
}
if ($did == 8) {
did -r $dname 13,14,15,16
}
}
on *:DIALOG:twitter_stats:menu:2,3: {
if ($did == 2) {
did -r $dname 5,6,7,8
}
if ($did == 3) {
dialog -x twitter_stats twitter_stats
}
}
alias -l TwitSearchStats {
if ($sock(TwitSearchStats)) { sockclose $sockname | did -a twitter_stats 17 Error, Please try again. }
else {
sockopen TwitSearchStats twitter.com 80
}
}
on *:SOCKOPEN:TwitSearchStats: {
if ($sockerr) { did -a twitter_stats 17 Error, Please try again. }
else {
sockwrite -nt $sockname GET / $+ $did(twitter_stats,4).text HTTP/1.0
sockwrite -nt $sockname Host: twitter.com
sockwrite -n $sockname $crlf
}
}
on *:SOCKREAD:TwitSearchStats: {
sockread %TwitStats
if (<span id="following_count" class="stats_count numeric"> isin %TwitStats) {
did -a twitter_stats 14 $htmlfree(%TwitStats)
}
elseif (<span id="follower_count" class="stats_count numeric"> isin %TwitStats) {
did -a twitter_stats 13 $htmlfree(%TwitStats)
}
elseif (<span id="lists_count" class="stats_count numeric"> isin %TwitStats) {
did -a twitter_stats 15 $htmlfree(%TwitStats)
}
elseif (<span id="update_count" class="stat_count"> isin %TwitStats) {
did -a twitter_stats 16 $remove($htmlfree(%TwitStats),Tweets)
}
}
alias -l twitterstats {
if (!$dialog(twitter_stats)) { dialog -m twitter_stats twitter_stats }
else { dialog -v twitter_stats twitter_stats }
}
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | return %x }
This script will search out the information for your Tweet's sent, followers, how many you are following and the total list's you are on.
There is a msg Chan button and an echo button incase you want to keep it secret. Or you could leave it in the dialog.