Last active
September 10, 2016 09:26
-
-
Save dorukcan/3a7ee36db6bd6dff361e8dba19de4a59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i = 2; i <= 14; i++) { | |
$.get("https://www.ayrintiyayinlari.com.tr/ucuzlatilmis-kitaplar/s/" + i, function(data) { | |
var html = $.parseHTML(data); | |
$(html).find(".span9 .editor .box").appendTo(".span9 .editor>div:eq(0)"); | |
}); | |
} | |
//--------------------------------------------------------------------------------------------------------------------------- | |
var arr = $(".box").get(); | |
arr.sort(function(a, b) { | |
return a.getElementsByClassName("author")[0].textContent == b.getElementsByClassName("author")[0].textContent ? | |
0 : | |
(a.getElementsByClassName("author")[0].textContent > b.getElementsByClassName("author")[0].textContent ? 1 : -1); | |
}); | |
$(".span9 .editor>div:eq(0)").html(arr); | |
//--------------------------------------------------------------------------------------------------------------------------- | |
String.prototype.toNumber= function (){ | |
return parseInt(this); | |
} | |
var arr = $(".box").get(); | |
arr.sort(function(a, b) { | |
return $(a).find(".old-product-price span").text().replace(",00 TL").toNumber() == $(b).find(".old-product-price span").text().replace(",00 TL").toNumber() ? | |
0 : | |
($(a).find(".old-product-price span").text().replace(",00 TL").toNumber() > $(b).find(".old-product-price span").text().replace(",00 TL").toNumber() ? 1 : -1); | |
}); | |
$(".span9 .editor>div:eq(0)").html(arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment