Count Widget
Code
// Javascript to load the information (this requires jQuery)
// You can put this in the head of the page or in the page body.
<script type="text/javascript">
jQuery(document).ready(function($) {
var group = 'economics';
var url = 'http://thedatahub.org/api/search/dataset?groups=' + group;
$.getJSON(url, function(data) {
// class selector for the page element where info should be inserted
$('.ckanjs-widget-count').html(data.count);
});
});
</script>
// And somewhere in the body of the html page ...
// this is where dataset count will be inserted
<span class="ckanjs-widget-count"></span>
Demo (view source to see HTML and javascript)
Datasets in the group: (this number computed live from the API).