Created
January 26, 2018 23:13
-
-
Save parzibyte/d3118ce8edb77ea047ad8ff7dd0f0771 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> | |
</head> | |
<body> | |
<h1>API de binbox.io</h1> | |
<p id="parrafoResultados">Aquí aparecerán los resultados en caso de que todo vaya bien :)</p> | |
<script type="text/javascript" src="http://binbox.io/api.js"></script> | |
<script type="text/javascript"> | |
//Aquí pondremos el código | |
var BB = new Binbox.API("http://parzibyte.binbox.io/"); | |
var parrafoResultados = document.querySelector("#parrafoResultados"); | |
BB.create({ | |
title: "Este es el título del enlace", | |
url: "https://www.parzibyte.me/blog" | |
}, function(resultados) { | |
if (resultados.ok) { | |
parrafoResultados.innerHTML = "El link acortado es: https://binbox.io/" + resultados.id; | |
} else { | |
parrafoResultados.innerHTML = "Ups, algo salió mal. El error es: " + resultados.error; | |
} | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment