From 6edbdfe1169139e28a5763be4163b2e204eeb8f0 Mon Sep 17 00:00:00 2001 From: Sergey Date: Sun, 26 Jun 2016 15:02:20 +0300 Subject: [PATCH 1/4] Country tag changed --- lib/hma-proxy-parse.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hma-proxy-parse.js b/lib/hma-proxy-parse.js index 6d99622..19b168b 100644 --- a/lib/hma-proxy-parse.js +++ b/lib/hma-proxy-parse.js @@ -21,12 +21,12 @@ module.exports = function(html) { var anonymity, connectionTime, country, element, ipBlock, ipSegments, port, protocol, speed, timestamp; element = $(this); timestamp = element.children(".timestamp").attr("rel"); - port = element.children("td:nth-of-type(3)").text().replace("\n", ""); - country = element.find("td .country").parent().attr("rel"); + port = element.children("td:nth-of-type(3)").text().replace(/\n/g, "").trim(); + country = element.find("td.country").parent().attr("rel"); speed = element.find("td .progress-indicator").eq(0).attr("value"); connectionTime = element.find("td .progress-indicator").eq(1).attr("value"); - protocol = element.children("td:nth-of-type(7)").text(); - anonymity = element.children("td:nth-of-type(8)").text(); + protocol = element.children("td:nth-of-type(7)").text().replace(/\n/g, "").trim(); + anonymity = element.children("td:nth-of-type(8)").text().replace(/\n/g, "").trim(); ipSegments = []; ipBlock = element.find("td:nth-of-type(2) > span"); ipBlock.contents().each(function() { From e5c7cecc43600b152b69bb4a7bc2ad4c20e1748a Mon Sep 17 00:00:00 2001 From: Sergey Date: Sun, 26 Jun 2016 15:07:03 +0300 Subject: [PATCH 2/4] Country tag changed --- lib/hma-proxy-parse.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hma-proxy-parse.coffee b/lib/hma-proxy-parse.coffee index 68077f0..fd0c872 100644 --- a/lib/hma-proxy-parse.coffee +++ b/lib/hma-proxy-parse.coffee @@ -19,12 +19,12 @@ module.exports = (html) -> rows.each -> element = $(this) timestamp = element.children(".timestamp").attr("rel") - port = element.children("td:nth-of-type(3)").text().replace("\n", "") - country = element.find("td .country").parent().attr("rel") + port = element.children("td:nth-of-type(3)").text().replace(/\n/g, "").trim() + country = element.find("td.country").parent().attr("rel") speed = element.find("td .progress-indicator").eq(0).attr("value") connectionTime = element.find("td .progress-indicator").eq(1).attr("value") - protocol = element.children("td:nth-of-type(7)").text() - anonymity = element.children("td:nth-of-type(8)").text() + protocol = element.children("td:nth-of-type(7)").text().replace(/\n/g, "").trim() + anonymity = element.children("td:nth-of-type(8)").text().replace(/\n/g, "").trim() ipSegments = [] From 0b59ed88cba6b795fc7687d6f7e9ebf8842152df Mon Sep 17 00:00:00 2001 From: Sergey Date: Sun, 26 Jun 2016 15:11:48 +0300 Subject: [PATCH 3/4] td.country contains countryname itself --- lib/hma-proxy-parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hma-proxy-parse.js b/lib/hma-proxy-parse.js index 19b168b..034073b 100644 --- a/lib/hma-proxy-parse.js +++ b/lib/hma-proxy-parse.js @@ -22,7 +22,7 @@ module.exports = function(html) { element = $(this); timestamp = element.children(".timestamp").attr("rel"); port = element.children("td:nth-of-type(3)").text().replace(/\n/g, "").trim(); - country = element.find("td.country").parent().attr("rel"); + country = element.find("td.country").attr("rel"); speed = element.find("td .progress-indicator").eq(0).attr("value"); connectionTime = element.find("td .progress-indicator").eq(1).attr("value"); protocol = element.children("td:nth-of-type(7)").text().replace(/\n/g, "").trim(); From 8b0e29ae088502da4bb637e19f69b5c04960d6a6 Mon Sep 17 00:00:00 2001 From: Sergey Date: Sun, 26 Jun 2016 15:12:18 +0300 Subject: [PATCH 4/4] td.country contains countryname itself --- lib/hma-proxy-parse.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hma-proxy-parse.coffee b/lib/hma-proxy-parse.coffee index fd0c872..9e6727e 100644 --- a/lib/hma-proxy-parse.coffee +++ b/lib/hma-proxy-parse.coffee @@ -20,7 +20,7 @@ module.exports = (html) -> element = $(this) timestamp = element.children(".timestamp").attr("rel") port = element.children("td:nth-of-type(3)").text().replace(/\n/g, "").trim() - country = element.find("td.country").parent().attr("rel") + country = element.find("td.country").attr("rel") speed = element.find("td .progress-indicator").eq(0).attr("value") connectionTime = element.find("td .progress-indicator").eq(1).attr("value") protocol = element.children("td:nth-of-type(7)").text().replace(/\n/g, "").trim()