Top

URL fetcher


mIRC Code

Please Register to submit score.
Bookmark and Share
Average Score  9.1 (of 7 scores)
Date Added  Feb 19, 2008
Last Updated  Feb 23, 2008
Tags  fetcher  url 

Description

Website title fetcher by Lindrian
Simply paste into remotes and when someone says a URL it will trigger.
(You can't trigger it yourself, since there's no INPUT event.)

Enjoy! :)

Update: made it only trigger once on each website, so if you post the same website 10 times it'll only show info about it once.

Grab the Code

on *:TEXT:*:#: rtc $chan $1-
on *:ACTION:*:#: rtc $chan $1-
on *:sockopen:website.*: {
  if (!$sockerr) {
    tokenize 32 $($+(%,$sockname),2)
    sockwrite -n $sockname GET $2 HTTP/1.1
    sockwrite -n $sockname Host: $1
    sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
    sockwrite -n $sockname Accept: */*
    sockwrite -n $sockname Connection: Close
    sockwrite -n $sockname $crlf
  }
  else unset $+(%,$sockname)
}
on *:sockread:website.*: {
  var %x, %z = $sockname, %e = $($+(%,%z),2)
  sockread -f %x
  if ($regex(%x,/<title[\w\s="]*>(.*?)<\/title>/i)) {
    tokenize 32 %e
    var %s = $btc(Url:) $+(http://,$+($1,$iif($2 != /,$2))) - $btc(Title:) $ptc($regml(1)) $iif($4,$4)
    msg $3 $iif(c isincs $chan($3).mode,$strip(%s),%s)
    unset $+(%,$(%z,2))
    .sockclose %z
  }
  if (*HTTP*302* iswm %x) set -e %web.tmp 1
  if (Location: isin %x) {
    if ($mtc(%x)) {
      tokenize 32 %e
      sockclose %z
      soc $regml(web,1) $iif($regml(web,2),$v1,/) $iif($3,$3,1) %z $iif(%web.tmp,Redirected)
      unset %web.tmp
    }
  }
}
on *:sockclose:website.*: unset $+(%,$sockname)
alias -l soc {
  var %x = $iif($4,$4,$+(website.,$r(a,z),$r(a,z),$r(a,z),$r(0,9),$r(0,9),$r(0,9)))
  set -e $+(%,%x) $1-2 $iif($3 ischan && $me ison $3,$3) $iif($5,$ntc($5))
  sockopen %x $1 80
}
alias -l mtc return $regex(web,$1,/(?:https?:\/\/)?((?:www\.)?[\w-.]+\.(?>[a-z]{2,4})(?![a-z]))([\w-_#?=%.\/&?]+)?/ig)
alias -l ptc return $replacecs($1,&mdash;,-,&quot;,",&amp;,&,&lt;,<,&gt;,>,é,$chr(233),ç,$chr(231),&ccedil;,$chr(231),&ntilde;,$chr(241),Ñ,$chr(209),Ü,$chr(220),ô,$chr(244))
alias -l btc return $+($chr(2),$1,$chr(2))
alias -l ntc return $+($chr(40),$1,$chr(41))
alias rtc {
  if ($mtc($2-)) && (!%website.flood [ $+ [ $regml(web,1) ] ]) {
    var %x = 1, %v 
    while ($regml(web,%x)) {
      var %z = $iif(/ isin $regml(web,$calc(%x +1)),$v2,/), %i = $regml(web,%x)
      if (/ !isin %i) && (!$istok(%v,%i,32)) {
        soc %i %z $1
        %v = %v %i
      }
      inc %x 1
    }
    set -eu5 %website.flood $+ $regml(web,1) 1
  }
}

Comments

  (30)  RSS
jonesy44
Comments: 1,964
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
Damn, that's a lotta script for a snippet i'd've thought would've been a lot easier :s
I only found it returned the web title, or am i missing something here?

Nice script overall, sockets aren't my *strong* point, but i can see the basics =D


~TH
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
Thats what its supposed to do, return the title of websites.
jonesy44
Comments: 1,964
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
It's nice, i like it =D
good for a bot, good job Lindrian


~TH
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
Thanks :)
jonesy44
Comments: 1,964
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
I honestly admire those who know sockets well, they sure as hell are not easy to code, i've just finished a SHOUTcast socket for a radio station, but needed some help ;__; hehe

~TH
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 19, 2008
Updated a little.
Ken
Comments: 8
 
mIRC Snippet:  URL fetcher
Posted Feb 21, 2008
This is excellent! I found this to be very useful, and the coding is impressive.

I think you should make it optional between echo and a message. :(
mountaindew
Comments: 1,830
 
mIRC Snippet:  URL fetcher
Posted Feb 21, 2008
well, if it's an on text, and the bot echoed it, you wouldn't be able to see it
Ken
Comments: 8
 
mIRC Snippet:  URL fetcher
Posted Feb 21, 2008
I see your point, however, it would be nice to make this for personal use. Also, if this was created for a bot, I think that the author should state that in the introduction. :)
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 23, 2008
No score yet :X?
Scakk
Comments: 319
 
mIRC Snippet:  URL fetcher
Posted Feb 23, 2008
I do like this. Could you possible make it where you need to trigger it instead of it happening whenever someone post a website. If people do not want the title of the website it could be annoying. However if people wish to know the title they could do so by triggering it.

*9/10 from me :)
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 23, 2008
You can simply change the on text event to this:
Code:

on *:TEXT:!url *:#: rtc $chan $2


Also updated the code slightly.
Scakk
Comments: 319
 
mIRC Snippet:  URL fetcher
Posted Feb 23, 2008
Thanks. I knew I could change the on text part but was unsure if it would mess upi the rest of the script or not so I figured it best to ask the creator.

Keep up the good work.
Lindrian
Comments: 760
 
mIRC Snippet:  URL fetcher
Posted Feb 23, 2008
Thanks :)
TwistedHumor
Comments: 20
 
mIRC Snippet:  URL fetcher
Posted Oct 24, 2008
Also will return your IP is someone posts up http://whatsmyip.org
Might wanna add a blocker to that or code a halt...?
TwistedHumor
Comments: 20
 
mIRC Snippet:  URL fetcher
Posted Oct 25, 2008
Actually I've came up with a fix for it with some help of friends on Gnet.
Code:
on *:TEXT:*:#: if (*whatsmyip* !iswm $1-) { rtc $chan $1- }
on *:ACTION:*:#: if (*whatsmyip* !iswm $1-) { rtc $chan $1- }
TwistedHumor
Comments: 20
 
mIRC Snippet:  URL fetcher
Posted Oct 25, 2008
Then incase kids are in the room...

Code:
on *:TEXT:*:#: if (*whatsmyip* !iswm $1-) && (*porn* !iswm $1-) { rtc $chan $1- }
on *:ACTION:*:#: if (*whatsmyip* !iswm $1-) && (*porn* !iswm $1-) { rtc $chan $1- }


Great Work...
10/10
flc86
Comments: 2
 
mIRC Snippet:  URL fetcher
Posted Apr 10, 2009
There is a little problem with it.

When in URL there is " , " it shows error (404 Not Found).
Anthrophobic
Comments: 27
 
mIRC Snippet:  URL fetcher
Posted May 10, 2009
Just noticed this was resolved..lawl
montague
Comments: 49
 
mIRC Snippet:  URL fetcher
Posted May 11, 2009
+1 like ;D
Testor
Comments: 102
 
mIRC Snippet:  URL fetcher
Posted May 11, 2009
Seems good, can stop me being linked to "Certain" Sites I guess :P
Seems like quite complicated code you've got there, Nice Job :)
LightMatter
Comments: 1
 
mIRC Snippet:  URL fetcher
Posted Jun 30, 2009
* /sockopen: 'Redirected' socket in use (line 41,
VinX
Comments: 70
 
mIRC Snippet:  URL fetcher
Posted Jul 31, 2009
works 100% perfect for me :)
k0ji
Comments: 27
 
mIRC Snippet:  URL fetcher
Posted Aug 01, 2009
[10:32] <+Ugawa> wb k.velo
[10:32] <@Taskia> Url: http://k.velo - Title: ERROR: The requested URL could not be retrieved
jonesy44
Comments: 1,964
 
mIRC Snippet:  URL fetcher
Posted Aug 02, 2009
Unlucky his name matched a weburl lmao..
k0ji
Comments: 27
 
mIRC Snippet:  URL fetcher
Posted Aug 02, 2009
man.adat , Ada.tp etc... **.** Title: ERROR: The requested URL could not be retrieved

how to edit ???
jonesy44
Comments: 1,964
 
mIRC Snippet:  URL fetcher
Posted Aug 02, 2009
remove the script.
miniCruzer
Comments: 60
 
mIRC Snippet:  URL fetcher
Posted Sep 03, 2009
I like it, you should've added colors though
Exterus
Comments: 8
 
mIRC Snippet:  URL fetcher
Posted Jun 05, 2010
I like the script a lot! But it doesn't recognize youtube urls, for some reason. Is it possible that might change at some point? :)
cptpan
Comments: 37
 
mIRC Snippet:  URL fetcher
Posted Jun 17, 2010
Work great, thanks

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom