Created
March 6, 2019 22:07
-
-
Save falehenrique/85be52f61dcbb6426aeace94852116ef 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>Page Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<link | |
rel="stylesheet" | |
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" | |
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" | |
crossorigin="anonymous" | |
/> | |
<script | |
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" | |
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" | |
crossorigin="anonymous" | |
></script> | |
<style></style> | |
<script> | |
let products = { | |
products: [ | |
{ key: "cart-magento", name: "Magento" }, | |
{ key: "cart-woocommerce", name: "Woocommerce" }, | |
{ key: "cart-prestashop-6", name: "Prestashop 6" }, | |
{ key: "cart-prestashop-7", name: "Prestashop 7" }, | |
{ key: "cart-wpecommerce", name: "WpeCommerce 7" }, | |
{ key: "cart-opencart", name: "Open Cart" }, | |
{ key: "cart-virtuemart", name: "Virtue Mart"} | |
] | |
}; | |
var address = | |
"https://api.mercadopago.com/devtools/lastversion/cart-prestashop-6"; | |
products.products.forEach(data => { | |
$.get( | |
"https://api.mercadopago.com/devtools/lastversion/" + data.key, | |
function(response) { | |
console.info(response); | |
if (response.status == undefined && response.status != 404 && response.release.tag_name != undefined ) { | |
createCard(response, data.name); | |
} | |
} | |
); | |
}); | |
function createCard(response, name) { | |
var html = ""; | |
html += "<div class='col px-md-2 mt-2'>"; | |
html += "<div class='card' style='width: 15rem;'> "; | |
html += "<div class='card-body'>"; | |
html += | |
"<h5 class='card-title'>" + name + "</h5>"; | |
html += | |
"<p class='text-primary'>" + | |
response.release.tag_name + | |
"</p>"; | |
html += | |
"<a href='" + | |
response.release.url + | |
"' class='card-link'> Download </a>"; | |
html += "</div>"; | |
html += "</div>"; | |
html += "</div>"; | |
html += "<br>"; | |
$("#containerCards").append(html); | |
} | |
</script> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row mx-md-n5" id="containerCards"></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment