Ask Giúp script đổi click link cho blogspot

ga4ever

Hero
Joined
Jan 16, 2012
Messages
612
Reactions
351
MR
0.002
Hiện đang làm cái blog movie = blogspot , cũng được kha khá lượt view mà bữa giờ đói VPS nên ngồi nghiên cứu lại thì có cái vụ biến text link thành click link để chiến website sale.
Kiếm được cái code biến text link thành click link nhưng hình như không work trên blogspot trong editor của blogspot nó có mà phải bỏ từng link vô, mỗi bài cả chục link mà bỏ từng cái thì lâu quá :( . Ai biết thì giúp nha, thanks :D
Code:
jQuery.fn.textNodes = function() {
    var ret = [];
    this.contents().each(function() {
        var fn = arguments.callee;
        if(this.nodeType == 3) {
            ret.push(this);
        } else if(this.nodeType==1 &&!(
        this.tagName.toLowerCase()=='script' ||
        this.tagName.toLowerCase()=='head' ||
        this.tagName.toLowerCase()=='iframe' ||
        this.tagName.toLowerCase()=='textarea' ||
        this.tagName.toLowerCase()=='option' ||
        this.tagName.toLowerCase()=='style' ||
        this.tagName.toLowerCase()=='title' ||
        this.tagName.toLowerCase()=='a')){
            jQuery(this).contents().each(fn);
        }
    });
    return ret;
}

jQuery.fn.hfautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:hotfile.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:hotfile.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.fsautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.smautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:sharingmatrix.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:sharingmatrix.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.fsonicautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:filesonic.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:filesonic.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.frautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:filereactor.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:filereactor.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.usautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:uploadstation.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:uploadstation.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

jQuery.fn.wuautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:wupload.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:wupload.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
        });
    });
}

$(function() {
    $("div").hfautolink();
	$("div").fsautolink();
	$("div").smautolink();
	$("div").fsonicautolink();
	$("div").frautolink();
	$("div").usautolink();
	$("div").wuautolink();
});
 

nium4ever

Hero
Joined
Apr 13, 2010
Messages
1,236
Reactions
502
MR
0.006
mình tìm cái này cách đây cũng khá lâu rồi và kết quả là không tìm được, lúc lấy link thì lấy link dành cho website thôi " <a href="link">name</a>
 
mình tìm cái này cách đây cũng khá lâu rồi và kết quả là không tìm được, lúc lấy link thì lấy link dành cho website thôi " <a href="link">name</a>

Cũng tùy host nó có link cho website có host nó chỉ có direct link, buồn vậy, chắc là do chưa có pro nào nghiên cứu đó thôi :m017:
 
thì khi soạn bài sửa hết thành html rùi post lên,direct wa html dễ òm mà có gì khó đâu :D
Căn bản là trang của chủ thớt là trang phim, 1 bài bao nhiêu link mà chèn thủ công cũng chết! Nhưng mà nếu ko ai có JS thì chắc cũng phải quay tay mà làm thôi! :binhsua85:
 
Vẫn đang tiếp tục nghiên cứu cái vấn đề, hy vọng sẽ có giải pháp :binhsua04: Hiện tay tất cả post mới thì post = tay hết rồi, gặp cái editor của thằng blogspot nó cùi bắp nữa chứ, link nhầm hoài :binhsua04:
Các post cũ thì vẫn là text link .......
 
Vẫn đang tiếp tục nghiên cứu cái vấn đề, hy vọng sẽ có giải pháp :binhsua04: Hiện tay tất cả post mới thì post = tay hết rồi, gặp cái editor của thằng blogspot nó cùi bắp nữa chứ, link nhầm hoài :binhsua04:
Các post cũ thì vẫn là text link .......
Chúc cậu sớm nghiên cứu và share cho anh em! Mềnh thì ko biết gì về JS, muốn tu luyện thêm mà mệt óc quá!
 

kuteomientay

Senior
Joined
Sep 19, 2011
Messages
595
Reactions
300
MR
0.000
làm blog post là sau này hối hần đó, nó xóa blog thì buồn lắm, công sức bao ngày tháng mà bị xóa thì buồn ko thể tả nổi
 
Có một mẹo nhỏ là dùng chức năng đổi text link thành Clickable link của ... các forum. Sau đó dùng 1 đoạn script đơn giản để chuyển BBcode ==> HTML code để post lên blogspot.

Blogspot thì vài ngày backup 1 lần, bị xóa lại lập blog khác thôi ^^. Chỉ cần lưu ý là mua domain ngoài chứ ko mua trực tiếp của blogspot, để nếu bị delete thì trỏ ngược về được

Cậu nói đúng ý dùng forum , nhưng là thế này: Cho link vào forum post , bấm xem trước (Go Advanced của mmo4vn) rồi copy mớ link lúc đó vào phần post bài của blogspot nhưng để ở chế độ "Viết"

Hoặc dùng code chuyển link qua dạng html link code, cũng khá dễ
 

Announcements

Today's birthdays

Forum statistics

Threads
423,815
Messages
7,133,512
Members
176,259
Latest member
anhnhienxanh

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom