Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 26, 2018 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/06fd3b973dcefae9912e059a8115ea71 to your computer and use it in GitHub Desktop.
Save parzibyte/06fd3b973dcefae9912e059a8115ea71 to your computer and use it in GitHub Desktop.
<!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 paste",
text: "Hola mundo :)"
}, function(resultados) {
if (resultados.ok) {
parrafoResultados.innerHTML = "Paste creado correctamente. Visítalo en: https://binbox.io/" + resultados.id + "#" + resultados.salt;
} 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