Poole App – Dynamic data to your static sites

Examples and Screencasts


Getting your data couldn’t be simpler. Here are some examples of using Poole to deliver comments for your blog in some popular techniques.

  • Curl
  • JavaScript in the browser
  • Using NodeJS, Gulp and Jekyll

Getting your data with CURL

Perhaps the simplest example of how to download all of the data submitted to one of your forms and save it in a file.

curl https://pooleapp.com/data/{API-SECRET}.json > data.json

JavaScript in the browser

Although exposing your API secret in the browser will allow others to detect a way to also query your data, Poole’s API is read only so your data is not exposed to the threat of being destroyed.

// Javascript using jQuery
var thispage = document.location.href;
$.getJSON('https://pooleapp.com/data/{API-SECRET}.json', function(d) {
  $.each(d, function(key, val) {
    //do stuff

Using NodeJS, Gulp and Jekyll

Jekyll v2.0 brought support for data files. This method uses a Gulp task to retrieve comments data from Poole and then save them as a data source for Jekyll to use in a standard build.

The Gulp task in a typical gulpfile.js file

// Get comments data from Poole

gulp.task("comments", function() {
  // set up the request to get comments as YAML
  var options = {
    hostname: 'pooleapp.com',
    port: 80,
    path: '/data/{API-SECRET}.yaml',
    method: 'GET',

  // Go and get data
  http.get(options, function(res) {
    var body = '';
    res.on('data', function(chunk) {
        body += chunk;
    res.on('end', function() {
      // Save the comments for jekyll to use as a data source
      fs.writeFile('./src/_data/comments.yml', body, function(err) {
        if(err) {
        } else {
          console.log("Comments data saved.");


Jekyll uses the data file to add comments to the correct posts

This assumes that Gulp has saved the comments data to the file _data/comments.yml

  {% for comment in site.data.comments.sessions %}
    {% if comment.path == page.url %}
      <time datetime="{{ comment.created | date_to_xmlschema }}">
        {{ comment.created | date_to_long_string  }}
      <a href="{{ comment.url }}">{{ comment.name }}</a>
      <p>{{ comment.name }}</p>
        {{ comment.comment }}
    {% endif %}
  {% endfor %}

Leave a Reply

Your email address will not be published. Required fields are marked *