@@ -0,0 +1,1462 @@
+$(document).ready(function ()%7B%0A  $('#btnGetStories').click(function()%7B%0A    var requestData = $('#txtDomain').val();%0A%0A    var resultElement = $('#resultDiv');%0A%0A    var cbKeyDisplay = config.cbKey;%0A%0A    $.ajax(%7B%0A      url : 'http://api.chartbeat.com/live/toppages/v3/?apikey=' + cbKeyDisplay,%0A      method: 'get',%0A      data: %7Bhost: requestData%7D,%0A      dataType: 'json',%0A      success: function(data)%7B%0A        var dt = new Date();%0A        resultElement.html(%22%3Cb%3E Request made at %22 + dt + %22%3C/b%3E%22);%0A        if (data.pages%5B1%5D.path.includes(requestData))%7B%0A        // the following loops assume that the page with most concurrents is always the homepage. Logic to be added in case that every changes.%0A        // You can swap out the commented logic below for more pages%0A        // for (var i = 1; i %3C= data.pages.length; i++)%7B%0A            for (var i = 0; i %3C 6; i++)%7B%0A              if (data.pages%5Bi%5D.path === requestData + %22/%22) %7B continue; %7D%0A              resultElement.append('%3Ch4%3E' + '%3Ca href=%22https://' + data.pages%5Bi%5D.path + '%22 target=%22_blank%22%3E'+ data.pages%5Bi%5D.title + '%3C/a%3E %3C/h4%3E');%0A            %7D%0A      %7D else %7B%0A          for (var i = 0; i %3C 6; i++)%7B%0A              if (data.pages%5Bi%5D.path === %22/%22) %7B continue; %7D%0A              console.log(data.pages%5Bi%5D.path);%0A              resultElement.append('%3Ch4%3E' + '%3Ca href=%22https://' + requestData + data.pages%5Bi%5D.path + '%22 target=%22_blank%22%3E'+ data.pages%5Bi%5D.title + '%3C/a%3E %3C/h4%3E')%0A          %7D;%0A      %7D%0A%0A      %7D%0A    %7D)%0A  %7D);%0A%7D);%0A

update cb_parser without error handling logic