Created
December 5, 2016 14:30
-
-
Save aaizemberg/2a09a5195e5bbeafc8cb8f1b7d5e118c to your computer and use it in GitHub Desktop.
Las noticias mas importantes del dia
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"> | |
<script src="https://code.jquery.com/jquery.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.3/d3.min.js"></script> | |
<meta name="viewport" content="width=device-width"> | |
<title>Top 100</title> | |
</head> | |
<body> | |
<script> | |
var today = new Date(); | |
var dd = today.getDate(); | |
var mm = today.getMonth()+1; | |
var yyyy = today.getFullYear(); | |
if (dd<10) { | |
dd='0'+dd | |
} | |
if (mm<10) { | |
mm='0'+mm | |
} | |
var fecha = yyyy + '-' + mm + '-' + dd; | |
var url = "http://infovis2.it.itba.edu.ar/news-visualization/api/word-cloud?&date1=" + fecha + "&api=2.0&limit=100"; | |
d3.json( url , function(error, data) { | |
if (error) throw error; | |
d3.select("body").append("h1").text("Las 100 noticias mas importantes del " + fecha) | |
var ul = d3.select("body").append("ul"); | |
ul.selectAll("li").data(data).enter().append("li") | |
.html( function(d,i) {return "<a href='http://infovis.it.itba.edu.ar/news/titulos.php?date1=" + fecha + "&keyword="+d[0]+"&api=2.0'>"+d[0]+"</a>" + " ("+d[1]+")"}) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment