mIRC Home    About    Download    Register    News    Help

Print Thread
#236465 28/02/12 06:50 PM
Joined: Jan 2010
Posts: 51
L
Lenooox Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2010
Posts: 51
anyone can help me ! i do not know what happend ! i dont get error message or something! but im not get answer \:\(

Code:
alias insane_check {
  sockclose insaneforum
  sockopen insaneforum www.insaneboard.comeze.com 80
  /timerInsaneForumTimeout 1 12 sockclose insaneforum
}
ON *:SOCKOPEN:insaneforum: {
  if ($sockerr > 0) { /echo -ta open error | return }
  sockwrite -n $sockname GET /news.php HTTP/1.0
  sockwrite -n $sockname Host: www.insaneboard.comeze.com
  ;sockwrite -n $sockname User-Agent: */*
  ;sockwrite -n $sockname Connection: Close
  sockwrite -n $sockname $crlf
}
ON *:SOCKREAD:insaneforum: {
  /timerInsaneForumTimeout off
  if ($sockerr > 0) { /echo -ta read error | return }
  var %read, %pattern
  sockread -f %read
  ;/echo -tag %read

  %pattern = /<strong>Guests Online:<\/strong>\s*(\d+).*?<strong>Members Online:<\/strong>\s*(\d+)/
  if ($regex(%read,%pattern)) { set -e %insane_guests $regml(1) | set -e %insane_guests $regml(2) }

  %pattern = /<strong>Total Members:</strong>\s*(\d+)/
  if ($regex(%read,%pattern)) { set -e %insane_total $regml(1) }

  %pattern = /<strong>Newest Member:<\/strong>\s*([^<]+)<\/td>/
  if ($regex(%read,%pattern)) { set -e %insane_new_member $regml(1) }
}
ON *:SOCKCLOSE:insaneforum: {
  /echo -ta closed
  /echo -ta GUESTS ONLINE: $iif(%insane_guests,$v1,N/A) - MEMBERS ONLINE: $iif(%insane_members,$v1,N/A) - TOTAL ONLINE USERS: $iif(%insane_total,$v1,N/A) - NEWEST MEMBER: $iif(%insane_new_member,$v1,N/A)
}


(\__/)
(='.'=)
(")_(")
Bunny Hopp

QuakeNet@ #Lenoox <> visit http://www.insaneboard.comeze.com
Lenooox #236470 28/02/12 10:22 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It's very possible that the forum changed the HTML slightly on the website and your script no longer matches the right data. In that case it would not give you an error OR the right answer.

For instance, when I visit the URL you're listing, I don't see "Members online", I see "Who is online".


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Lenooox #236500 29/02/12 10:26 PM
Joined: Jan 2010
Posts: 51
L
Lenooox Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2010
Posts: 51
maybe can you help me to fix it?


(\__/)
(='.'=)
(")_(")
Bunny Hopp

QuakeNet@ #Lenoox <> visit http://www.insaneboard.comeze.com
Lenooox #236508 01/03/12 02:01 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You simply have to update the $regex calls to capture the new HTML output on the page. Did you write this script yourself? If so, you should know how to do it. If not, I would suggest asking the person who did (I'm guessing you know this person, as it seems fairly custom) or waiting for someone who has the time to rewrite this for you (that seems to be what you are asking for).


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Lenooox #236515 01/03/12 09:30 AM
Joined: Jan 2010
Posts: 51
L
Lenooox Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2010
Posts: 51
not, unfortunately, not me write frown
two people helped me! but they disappeared in mirc frown
and im so stupid for regex thing :'(
if you can please help me :$


(\__/)
(='.'=)
(")_(")
Bunny Hopp

QuakeNet@ #Lenoox <> visit http://www.insaneboard.comeze.com
Lenooox #236538 03/03/12 08:04 PM
Joined: Jan 2010
Posts: 51
L
Lenooox Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2010
Posts: 51
Please help me


(\__/)
(='.'=)
(")_(")
Bunny Hopp

QuakeNet@ #Lenoox <> visit http://www.insaneboard.comeze.com
Lenooox #236542 03/03/12 09:55 PM
Joined: Nov 2009
Posts: 295
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
Code:
alias insane_check {
  sockclose insaneforum
  sockopen insaneforum www.insaneboard.comeze.com 80
  .timerInsaneForumTimeout 1 12 sockclose insaneforum
}
ON *:SOCKOPEN:insaneforum: {
  if ($sockerr > 0) { /echo -ta open error | return }
  sockwrite -n $sockname GET /news.php HTTP/1.0
  sockwrite -n $sockname Host: www.insaneboard.comeze.com
  sockwrite -n $sockname $crlf
}
ON *:SOCKREAD:insaneforum: {
  .timerInsaneForumTimeout off
  sockread %isnane.result
  while ($sockbr) {
    if (Members</td> isin %insane.result) sockread %insane_members
    if (Guests</td> isin %insane.result) sockread %insane_guests
    if (Members Total</td> isin %insane.result) sockread %insane_total
    if (Newest Member</td> isin %insane.result) sockread %insane_new_member
    sockread %insane.result
  }
}
alias parsehtml {
  set -l %temp $regsubex($1,/<[^>]+[>$]>?/g,)
  while (($regex(%temp,/&#(\d+);/)) && ($regml(1) isnum 32-255)) set -l %temp $replacex(%temp,$+(&#,$regml(1),;),$chr($regml(1)))
  while (($regex(%temp,/&#x(.*?);/)) && ($base($regml(1),16,10) isnum 32-255)) set -l %temp $replacex(%temp,$+(&#x,$regml(1),;),$chr($base($regml(1),16,10)))
  set -l %finished $replacex(%temp,&nbsp;,$chr(160),&quot;,",&middot;,·,&lt;,<,&gt;,>,&amp;,&,&ndash;,–,&eacute;,$chr(233))
  return %finished
}
ON *:SOCKCLOSE:insaneforum: {
  echo -ta GUESTS ONLINE: $iif(%insane_guests,$parsehtml($v1),N/A) - MEMBERS ONLINE: $iif(%insane_members,$parsehtml($v1),N/A) - TOTAL ONLINE USERS: $iif(%insane_total,$parsehtml($v1),N/A) - NEWEST MEMBER: $iif(%insane_new_member,$parsehtml($v1),N/A)
}


There isn't a newest member listed on the site so that part may or may not work. Depending on if my guess is correct. Also rewrote a bit to suite my liking.


http://scripting.pball.win
My personal site with some scripts I've released.
Lenooox #236543 03/03/12 10:12 PM
Joined: Jan 2010
Posts: 51
L
Lenooox Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2010
Posts: 51
awesome mate :> Thank you very mcuh :P laugh


(\__/)
(='.'=)
(")_(")
Bunny Hopp

QuakeNet@ #Lenoox <> visit http://www.insaneboard.comeze.com

Link Copied to Clipboard