forum info socket

By PuNkTuReD on Sep 10, 2008

this wont have much use to others but it may help in scripting some how.

this dialog opens a socket to my forum and displays some info

takes a second or two after opening dialog to collect forum info

menu * {
Forum Stats:dialog -dm ForumStats ForumStats
}
alias ForumStats {
  if ($sock(ForumStats))  { echo -a 4Socket Currently Exists. | .halt }
  sockopen ForumStats mircforum.smfforfree4.com 80                                 
}
on *:SOCKOPEN:ForumStats: {
  sockwrite -nt $sockname GET /index.php HTTP/1.1
  sockwrite -nt $sockname Host: mircforum.smfforfree4.com
  sockwrite -nt $sockname Connection: Keep-Alive
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:ForumStats: {
  if ($sockerr) {
    echo @Forum 4Socket Error: $sockname $+ . Error code: $sockerr ( $+ $sock($sockname).wsmsg | return
    halt
  }
  var %sockreader
  sockread %sockreader
  if (*Latest Member:* iswm %sockreader) {
    set %ForumStats.data %sockreader 
    set %ForumStats.latest.member $($gettok($($+(%,ForumStats.data),2) $+ ,5,46))
    did -a ForumStats 3 $($gettok($($+(%,ForumStats.data),2) $+ ,1,46))
    set %ForumStats.latest.member $replace($($+(%,ForumStats.latest.member),2),php?action=profile;u=,)
    set %ForumStats.latest.member $replace($($+(%,ForumStats.latest.member),2),">,)
    set %ForumStats.latest.member $replace($($+(%,ForumStats.latest.member),2),*,)
    set %ForumStats.latest.member $replace($($+(%,ForumStats.latest.member),2),</a></b>,)
    did -ra ForumStats 14 %ForumStats.latest.member
  }
  if (*Guests,* iswm %sockreader) || (*Users iswm %sockreader) {
    set %forum.users %sockreader
    did -a ForumStats 5 %forum.users
  }
  if (*Most Online Today:* iswm %sockreader) {
    set %ForumStats.mosttoday %sockreader 
    set %ForumStats.mosttoday $replace($($+(%,ForumStats.mosttoday),2),Most Online Today: <b>,)
    set %ForumStats.mosttoday $replace($($+(%,ForumStats.mosttoday),2),.,)
    set %ForumStats.mosttoday $replace($($+(%,ForumStats.mosttoday),2),</b>,)
    did -a ForumStats 7 %ForumStats.mosttoday
  }
  if (*Most Online Ever:* iswm %sockreader) {
    set %ForumStats.mostever %sockreader 
    set %ForumStats.mostever $replace($($+(%,ForumStats.mostever),2),Most Online Ever:,)
    did -a ForumStats 9 %ForumStats.mostever
    sockclose ForumStats
  }
}
on *:SOCKCLOSE:ForumStats: {
  echo -a 4-LogIn Cancelled. $sock($sockname).wsmsg
}
;---------------------------------------------------------------------------------
dialog  ForumStats {
  title "••http://mircforum.smfforfree4.com••"
  size -1 -1 150 73
  option dbu
  box "", 1, 2 1 146 70
  text "Topics General:", 2, 8 8 40 8
  edit "", 3, 50 7 95 10, multi autohs 
  text "Users Online:", 4, 60 18 37 8
  edit "", 5, 95 17 50 10, multi autohs
  text "Most Today:", 6, 60 28 37 8
  edit "", 7, 95 27 50 10, multi autohs
  text "Most Ever:", 8, 15 38 37 8
  edit "", 9, 50 37 95 10, multi autohs
  button "UpDate", 10, 5 50 45 10
  text "Forum stats for:", 11, 8 61 40 8
  link "http://mircforum.smfforfree4.com", 12, 55 61 85 8
  text "Newest Member:", 13, 52 48 50 8
  edit "", 14, 95 47 50 10, multi autohs
}
on *:dialog:ForumStats:sclick:*:{ forumstats }
on *:dialog:ForumStats:init:0:{ forumstats }
alias Forum { dialog -dm ForumStats ForumStats }

Comments

Sign in to comment.
PuNkTuReD   -  Jan 23, 2010

yea i will see what i can do, atm when i try to retrieve the info with mirc i am getting this error

Unreal Insane Clan: You are using an invalid IP

ill let ya know how i go

 Respond  
Lenooox   -  Jan 23, 2010

thank you :)

 Respond  
Lenooox   -  Jan 23, 2010

hey hey , we wanna creat a forum shocket script for our site , but i didnt know how or what :( i tried your script , and I modified the path ... !i tried also Forum Stats on the topic, Latest users , last forum post etc.. but nothing ,dosent work for me ! :( Can you help me ? or you have any idea?
(sorry for my English)

 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.