Poole App – Dynamic data to your static sites

About Poole

What the blazes is this?

Poole is intended to be a useful companion to all those sites which are generated into static files and then uploaded to be served with no server-side logic. We think that you can include user generated content and other posted material even if you serve static files. Your build process just needs help from a faithful helper.

How do I use this?

After creating a form to use, you simply include that form on which ever pages you want, and then start collecting content here. You can then query Poole either as part of your site compilation process, or even in the browser with JavaScript in order to include that content into your site. We have some examples for you to take a look at.

How much does Poole cost to use?

Poole is free to use, but we set some limits. You can have up to 10 forms and make up to 5000 Posts and up to 3000 Gets per form each month, free of charge. We think that for most people, that will be plenty but a pro version with higher limits is coming soon.

We have soft limits and will let you know if you are going over your allowance. We will never just stop processing your data without talking to you first.

The maximum payload size of any Post is 0.5MB. That’s a lot of text and should be plenty for most uses. If you have a usecase which demands more, tell us about it over on the roadmap page.

Do you do change any of the content submitted?

A principle of Poole is that it stays as dumb as possible. We’d prefer to keep this simple so that it is suitable for a lot of different uses. As such we don’t transform or manipulate your data, with one important exception:

In order to protect our system and yours from potential attacks, SQL or script injections and other nasties, we will escape any HTML, JavaScript or other code we detect.

Privacy and security

  • We won’t ever inspect your data or to try to learn about you so that we can sell you things.
  • We will never sell your content or information to anyone.
  • We wouldn’t put secret, sensitive content up here – all data is stored on shared virtual servers.
  • All data remains yours. You can always download all of the data from your forms

All data posted to Poole is posted at your own risk. Please refrain from posting confidential material.

Who is behind Poole?

Poole came about because we were scratching a bit of a web development itch. We built it because we needed it.

Alfredo Aguirre

  • Alfredo Aguirre
  • @a_alfredo
  • madewithbyt.es

Phil Hawksworth

  • Phil Hawksworth
  • @philhawksworth
  • hawksworx.com

Thanks and credits

  • The site UI is built on the Steve Smith’s Minimal theme.
  • The butler icon is a free icon from http://www.flaticon.com

Where did the name come from?

Poole was the name of Dr Jekyll’s butler in Robert Louis Stevenson’s book, The Strange case of Dr Jekyll and Mr Hyde. Since this site serves content to static sites, such as those generated by popular libraries like Jekyll or Hyde, the name Poole seemed fitting.

Examples and Screencasts

Examples

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) {
          console.log(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

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