mIRC Home    About    Download    Register    News    Help

Print Thread
#74360 07/03/04 06:05 PM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
Hi I have a search engine I am making for just scripting web sites. I made a bot right now that sits in a mIRC shannel and askes for Scripting links. When people give it to him it is saved in a text file. Is there a way to get it to be added to my search engine database? I have the PHP and SQL scripts for the search engine. I want it so when someone give it a link it will go to that link, see if its a realy link see if its scripting related then get its meta info and add it to my SQL database anyone know how to do this?

#74361 07/03/04 06:48 PM
Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
Firstly, you need to be sufficently happy you can actually use mIRC sockets, if so..

When the bot gets a link, immediately it opens a socket (sockopen) and goes to the website..
and on sockread, you can recieve a variety of results, but the two basic ones you want to look at is,
HTTP/1.1 404 Not Found, and, HTTP/1.1 200 OK

if you recieve an OK then, you can add the host/site, to a text file and then at the end of the day, or even immiately you can open another socket to YOUR site, which would run say, add.php?site=www.thissite.com and your PHP would take over and add it to mysql..

Alternatively, you can look at *?* google.com, for a mIRC script that connects to mysql from mirc and do it that way..

..if this hasnt helped at all, do feel free to post again and ill give you an example of the code.

#74362 07/03/04 06:54 PM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
mmmm ya i get what your saying but can I see some examples. I think im gonna have a big problem with the adding url to the php page becuse the way the page is set up is you have to type inthe link and then it will go look for the site get its meta info then add it to database. Im trying to do the same thing with the mIRC script and add it to the database with the others so this could take time. Feel free to past anything or ask for what i have ill be happy to show you or give you.

#74363 07/03/04 06:56 PM
Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
sure.. this is jus to help you out but..

alias ex {
var %.ex $+(ex.,$rand(1,1000)) | sockclose %.ex
var %.tmp $gettok($remove($1-,http://),1,47)
sockclose %.ex
sockopen %.ex %.tmp 80
sockmark %.ex $+(/,$gettok($remove($1-,http://),2-,47))
}

On *:Sockopen:ex.*:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Host: $ip
sockwrite $sockname $crlf
}

On *:Sockread:ex.*:{
sockread %ex
echo -s -data: %ex
}

typing;
/ex http://www.mirc.com/index.php gives you a 404 - non-existant
/ex http://www.mirc.com/index.html gives you a 200 - exists

#74364 07/03/04 07:04 PM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
hmm ya that works fine but how would i take out just the meta info and title of the page?

after that make it add in to the database..... ><

#74365 07/03/04 07:11 PM
Joined: Dec 2002
Posts: 787
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 787
you parse the echo -s -data: %ex line with some IF statements..

i.e.
if (*HTTP/1.1*OK* iswm %ex) { set %.exists 1 }
if (%exists) {
if (*TITLE* iswm %ex) { single $gettok here to get title }
elseif (*META* iswm %ex) { ..some $gettok parsing here.. }
}
}
else { sockclose $sockname }

Also you need to add unset %.exists at the start of the script, i.e. just after the alias 'ex' starts.

If you dont know how to use $gettok, perhaps try some examples using the format found in /help $gettok

#74366 07/03/04 07:18 PM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
O man this is gonna be a pain in the ass ><

#74367 08/03/04 09:58 PM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
Does anyone know where I can get a pre-made one that will do everyting that I have sead? Or do someof the things i want? please help Im lost .


Link Copied to Clipboard