[ Launch: commonwealth: crunchbase ] 9457496 by enjalot
-
-
Save enjalot/9457496 to your computer and use it in GitHub Desktop.
commonwealth: crunchbase
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
{"description":"commonwealth: crunchbase","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true,"inline-console":true,"thumbnail":"http://i.imgur.com/t2XqWy6.png"} |
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
var query = "select funded_year, funded_month, \ | |
sum(raised_amount) raised, count(*) funding_rounds \ | |
from crunchbase.funding \ | |
where funded_year >= 2000 \ | |
and raised_amount is not null \ | |
and funded_year is not null \ | |
and funded_month is not null \ | |
group by funded_year, funded_month \ | |
order by funded_year desc, funded_month desc \ | |
limit 1000;" | |
var url = queryToURL(query); | |
console.log(url); | |
d3.json(url, function(err, data) { | |
console.log(err) | |
console.log(data); | |
}) | |
function queryToURL(q) { | |
var regex = new RegExp("(\\s)+","g") | |
var qstr = q.replace(regex,"%20"); | |
return "http://commonwealth.io/api/v1/postgres?query=" + qstr; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment