mIRC Home    About    Download    Register    News    Help

Print Thread
#74425 08/03/04 01:13 PM
Joined: Oct 2003
Posts: 101
root66 Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Oct 2003
Posts: 101
It would be nice if mirc could grab the user, password, port, hostname, and path of a url in the list. I have it scripted now but its not the prettiest thing in the world. Anyone got something like this using $regex maybe?

Suggestion:
if $url(1) = http://test.com:81/test.html
then $url(1).host = test.com

Edit: Here is the alias I have been using

Code:
alias urldata {
  var %arg = $gettok($replace($1,/@,@),2,47) , %up = $iif(@ isin %arg,$gettok(%arg,1,64)) , %hp = $gettok($gettok(%arg,$iif(@ isin %arg,2,1),64),1,47) , %p = $$2
  if (%p == port) { return $iif($gettok(%hp,2,58) isnum 1-65535,$ifmatch,$iif($left($1,4) == ftp:,21,80)) }
  elseif (%p == user || %p == pass) { return $gettok(%up,$iif(%p == user,1,2),58) }
  elseif (%p == path) { return $+(/,$gettok($1,3-,47)) }
  elseif (%p == host) { return $gettok(%hp,1,58) }
}


$url(http://user:pass@site.com:81/test.html,path) = /test.html
$url(http://user:pass@site.com:81/test.html,host) = site.com
etc...

Last edited by root66; 08/03/04 02:41 PM.
Joined: Oct 2003
Posts: 101
root66 Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Oct 2003
Posts: 101
I am a little sorry that no one else liked this idea. frown


Link Copied to Clipboard