ThichCode.NET: Check the IP and display the shortened link with Javascript to optimize for making money online ThichCode.NET: Check the IP and display the shortened link with Javascript to optimize for making money online
ThichCode.NET

My blog

articles about technology, tricks, programming, ... from practical experience.
Check the IP and display the shortened link with Javascript to optimize for making money online

Check the IP and display the shortened link with Javascript to optimize for making money online

As the title of the article, I will build a code in Javascript to help you optimize the link to make money through many services such as 123link, adf.ly, ouo.io, shirk.me, linkshirk.net ... Here I will guide you how to do.

As the title of the article, I will build a code in Javascript to help you optimize the link to make money through many services such as 123link, adf.ly, ouo.io, shirk.me, linkshirk.net ... Here I will guide you how to do.

First of all, I will briefly talk about the shortened link and how to make money :  There are now many sites that allow us to make short links to earn income through link sharing (income is calculated by number View the reduced link, ranging from 1-3 USD / 1000 view - depending on the country). But here, the service will be limited to the following: 1 day only 2ip maximum access to the link provided by the provider to charge us. So, I will write a code to navigate the original link through a shortened link of another provider when I have enough 2ip access to the previous service provider.

I use blogger so I will limit the web language (can only use javascript) so can not use the api of the shortened link providers (if you have a private server can use php or C # for security Our original link - if you have the need to inbox yourself by FaceBook.com/thichcode.net page). Well, say a lot but actually the code is very short, you see the example below.

Note: The code above applies to the Jquery + Cookie Plugin. If your website is not available then insert these two files before the </ head> tag. According to you, the code is easy, you can see so I do not say much offline.
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js'></script>

Node : if your domain SSL (https) : https://api.ipify.org/?format=json (without limit) else : http://gd.geobytes.com/GetCityDetails?callback=?

Plugin is based on jquery:
//Chèn đoạn code này sau file jquery.min.js
$.fn.KK_ChangeLinkAds = function() {
var div = $(this);
var arr_ads = ["http://123link.co/st?api=1f82a4d689ef8afa738e5fe68160bfebf3f16b80&url=","http://adf.ly/5925108/","http://ouo.io/s/liThE2fW?s=","http://shink.me/s/371435?s=","http://linkshrink.net/z23e="];
$.getJSON('https://api.ipify.org/?format=json', function(e) {
var ip_client = e.ip;
var date = new Date();
date.setTime(date.getTime() + (5*60*1000));
if($.cookie('kk_kiem_tien') === undefined) $.cookie('kk_kiem_tien', ip_client + '|0|0', { expires: date, path: '/' });
$('div#cookie').text('Cookie : ' + $.cookie('kk_kiem_tien'));
$(div).each(function(){
$(this).attr("data-href",$(this).attr("href")).attr('href','javascript:void(0);').attr('target','_blank');
$(this).click(function(){
var datahref = $(this).attr('data-href');
var kk_ip_client = $.cookie('kk_kiem_tien').split('|')[0];
if (kk_ip_client == ip_client)
{
var datahref = $(this).attr('data-href');
var kk_ip_client = $.cookie('kk_kiem_tien').split('|')[0];
if (kk_ip_client == ip_client)
{
var stt = parseInt($.cookie('kk_kiem_tien').split('|')[1]);
var kk_clicks_ads = parseInt($.cookie('kk_kiem_tien').split('|')[2]);

if (kk_clicks_ads < 2) {}
else {
if (stt<arr_ads.length - 1) stt++;
else stt = 0;
kk_clicks_ads = 0;
}
$.cookie('kk_kiem_tien', ip_client + '|' + stt + '|' + (kk_clicks_ads + 1), { expires: date, path: '/' });
$('div#cookie').text('Cookie : ' + $.cookie('kk_kiem_tien'));
window.open(arr_ads[stt] + datahref,'_blank');
}
else $.cookie('kk_kiem_tien', ip_client + '|0|1', { expires: date, path: '/' });
}
});
   });
   });
}; 

//Gọi hàm khi dùng
$(".post-body a").KK_ChangeLinkAds();
This article helps ?
If this article does not address your issue, leave a comment below

3 comments:

  1. Cảm ơn bạn đã chia sẻ, mình đã thử thành công với jquery latest js, tuy nhiên khi sử dụng cho trang https lại không được: ví dụ http://itandblog.blogspot.com/p/asdf-fsf-ss-a.html thì OK, nhưng https://itandblog.blogspot.com/p/asdf-fsf-ss-a.html lại không được.
    Còn "Phiên bản Plugin trên nền jquery" mình thử nhưng chưa được, bạn có thể hướng dẫn thêm không
    Many thanks

    ReplyDelete
  2. mình cũng không hiểu lắm về chức năng này

    ReplyDelete
    Replies
    1. Chức năng này là tối ưu kiếm tiền với link rút gọn bạn nhé.

      Delete

Most read

Latest