MashhitDK commented on a Page, link checker  -  May 28, 2011

This should work

;**********************************************************
;*** Downloaded from http://www.hawkee.com/snippet/6941/
;**********************************************************
on *:TEXT:*:#: {
  if ((www. isin $1-) || (http:// isin $1-)) && (*whatsmyip* !iswm $1-) { sockclose linkchecker | set %linkchan $chan
    if (http:// isin $1-) { set %link $remove($matchtok($1-,http://,1,32),http://) | set %actlink $matchtok($1-,http://,1,32) }
    else { set %link $matchtok($1-,www.,1,32) | set %actlink $matchtok($1-,www.,1,32) }
    if (/ !isin %link) { set %link %link $+ / }
    sockopen linkchecker $remove($left(%link,$pos(%link,/,1)),/) 80
    halt
  }
}
on *:sockopen:linkchecker: {
  if $sockerr > 0 { sockclose $sockname | halt }
  sockwrite -n $sockname GET / $+ $right(%link,$calc($len(%link)- $pos(%link,/,1))) HTTP/1.1
  sockwrite -n $sockname Host: $remove($left(%link,$pos(%link,/,1)),/)
  sockwrite -n $sockname $crlf
}
on *:sockread:linkchecker: {
  if $sockerr > 0 { sockclose $sockname | halt }
  sockread %linkh
  if (%delbug != $null) && ($len(%linkch) <= 150) && (</title> !isin %linkh) { set %linkch %linkch %linkh }
  if (%delbug != $null) && (</title> isin %linkh) {
    ;    echo -t %linkchan 13 $+ $replace(%linkch,&quot;,",&apos;,',&amp;,&,&lt;,<,&gt;,>,&copy;,©,&reg;,®,&trade;,™,&euro;,€,&pound;,£,&yen;,¥) (4 %actlink )
    msg %linkchan $+(07,$replace($remove(%linkch,&#x202a;,&#x202c;&rlm;),&quot;,",&apos;,',&amp;,&,&lt;,<,&gt;,>,&copy;,©,&reg;,®,&trade;,™,&euro;,€,&pound;,£,&yen;,¥),) (4 %actlink )
    unset %delbug %link %linkchan %actlink
    sockclose $sockname
    halt
  }
  if (<title> isin %linkh) {
    set %linkch $remove($left(%linkh,$pos(%linkh,</title>,1)),</title>)
    set %linkch $right(%linkch,$calc($len(%linkch)- $pos(%linkch,<title>,1) -6))
    set %linkch $left(%linkch,$calc($len(%linkch)-1))
    set %delbug 1
    if (%linkch != $null) {
      ;      echo -t %linkchan 13 $+ $replace(%linkch,&quot;,",&apos;,',&amp;,&,&lt;,<,&gt;,>,&copy;,©,&reg;,®,&trade;,™,&euro;,€,&pound;,£,&yen;,¥) (4 %actlink ) 
      msg # %linkchan Title: $+(07,$replace($remove(%linkch,&#x202a;),&quot;,",&apos;,',&amp;,&,&lt;,<,&gt;,>,&copy;,©,&reg;,®,&trade;,™,&euro;,€,&pound;,£,&yen;,¥),) -> $+(04,%actlink,)
      sockclose $sockname
      unset %delbug %link %linkchan %actlink 
      halt
    }
  }
}

NOTE: That it's edited to msg channel instead of echo

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.