mIRC Home    About    Download    Register    News    Help

Print Thread
#83500 19/05/04 07:32 PM
Joined: May 2004
Posts: 3
I
Self-satisified door
OP Offline
Self-satisified door
I
Joined: May 2004
Posts: 3
before I start, I'm just gonna say that if there's a simple answer to this, i probably didn't find it because my brain is fried lately from exams

anyway....

i have this site for an irc game i'm running (link in sig), and i recently made the bot run a batch file to ftp rankings to the site. after that i got an idea, but i'm not sure if it's possible or how to go about it if it is. so here's the question:

If i can, how would I go about pulling information from a channel and displaying it on a webpage?

For instance, a person loads /index.php and it says "# users are currently in #pie" and maybe even "There are # people currently playing" (it voices people when they join the game)

my php knowledge is extremely basic, so I have no idea how i would go about doing this. i'd imagine it is possible though

so... any ideas?


#83501 20/05/04 01:39 AM
Joined: Dec 2002
Posts: 208
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
creat a data file with the desired information that php can read,

use mIRC to update the file localy, then use sockets to connect to your ftp server and upload the file

php can read the file to display the desired data.

if your not very handy with socket scripting in mIRC this may prove difficult. but i'm not gona code it for you .. so keep trying or find an addon someone has already made that does something similar. smile

hope this was informative.

Cobra^

#83502 20/05/04 01:41 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922

#83503 21/05/04 02:07 AM
Joined: Mar 2004
Posts: 457
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
this is some early socket stuff i did and i just keep reusing it as it seems to work fine:
Code:
alias socket {
  if ($sock(socket)) { sockclose socket }
  sockopen socket www.url.com 80
}
on *:sockopen:socket:{
  if (!$sockerr) { 
    sockwrite -n socket GET /index.php HTTP/1.1
    sockwrite -n socket Host: url here
    sockwrite -n socket User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
    sockwrite -n socket Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1..
    sockwrite -n socket Accept-Language: en-us
    sockwrite -n socket Accept-Encoding: gzip, deflate,compress;q=0.9..
    sockwrite -n socket Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
    sockwrite -n socket Keep-Alive: 300
    sockwrite -n socket Connection: keep-alive
    sockwrite -n socket Referer: url here
    sockwrite -n socket $crlf
  }
  else { echo its gone wrong...THE END IS NEIGH, RUN FOR COVER MY CHILDREN!!!! } 
}
on *:sockread:socket:{
  var %b
  sockread %b
  echo -s %b
  }
}


That will basically output the page's html into the status window. From that you should be able to find "anchors" and add an IF statement or 2 and there ya go.


Link Copied to Clipboard