Pastetool #435

URL: , Paste another

// Convert text URLs into Links
function ahrefs(s){
	s = s.replace(/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi,function(url){
	nice = url;
	if( url.match('^https?:\/\/') ){
		nice = nice.replace(/^https?:\/\//i,'')
	}else{
		url = 'http://'+url;
	}
	return '<a target="_blank" rel="nofollow" href="http://40bd4cee.linkbucks.com/url/'+ url +'">'+ nice.replace(/^www./i,'') +'</a>';
	});
	return s;
}

Download code

This javascript code was pasted on February 26, 2010




Protected with advance Anti-SPAM techniques :)
Coded and designed by Fedmich
Follow us on Twitter