diff --git a/views_autorefresh/ping.php.example b/views_autorefresh/ping.php.example
new file mode 100644
index 0000000..c8bbad7
--- /dev/null
+++ b/views_autorefresh/ping.php.example
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Example ping script.
+ *
+ * This script is intended to be used as a starting point to copy and
+ * adapt to your needs.
+ */
+
+define('DRUPAL_ROOT', '/path/to/drupal');
+
+// Prevent sql injection.
+$timestamp = $_GET['timestamp'];
+if (!is_numeric($timestamp)) {
+  die();
+}
+
+// Connect to drupal database.
+require_once DRUPAL_ROOT . '/sites/default/settings.php';
+
+$creds = $databases['default']['default'];
+$constr = sprintf("%s:dbname=%s", $creds['driver'], $creds['database']);
+$db = new PDO($constr, $creds['username'], $creds['password']);
+
+// Get count of new items.
+$result = $db->query("SELECT count(nid) FROM node WHERE created > $timestamp");
+
+
+// HTTP headers to prevent caching the result of this call.
+header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past (HTTP 1.0)
+
+// JSON response.
+print '{"pong":"' . $result->fetchColumn() . '"}';
diff --git a/views_autorefresh/views_autorefresh.info b/views_autorefresh/views_autorefresh.info
index d347534..0602f38 100644
--- a/views_autorefresh/views_autorefresh.info
+++ b/views_autorefresh/views_autorefresh.info
@@ -6,4 +6,4 @@ core = 7.x
 
 files[] = views_autorefresh_handler_argument_base.inc
 files[] = views_autorefresh_handler_argument_date.inc
-
+files[] = views_autorefresh_handler_area_autorefresh.inc
diff --git a/views_autorefresh/views_autorefresh.module b/views_autorefresh/views_autorefresh.module
index 6d2eca8..d102588 100644
--- a/views_autorefresh/views_autorefresh.module
+++ b/views_autorefresh/views_autorefresh.module
@@ -101,3 +101,16 @@ function __views_autorefresh_get_timestamp($view) {
   return $max;
 }
 
+/**
+ * Form alter to limit our autorefresh area to views header.
+ */
+function views_autorefresh_form_alter(&$form, $form_state) {
+  if (($form['#form_id'] == 'views_ui_add_item_form') && ($form_state['type'] != 'header')) {
+    $type = $form_state['type'];
+    $types = views_object_types();
+    if (isset($types[$type]['type']) && ($types[$type]['type'] == 'area')) {
+      unset($form['options']['name']['views.autorefresh']);
+    }
+  }
+}
+
diff --git a/views_autorefresh/views_autorefresh.views.inc b/views_autorefresh/views_autorefresh.views.inc
index 0fd14d9..ce94a58 100644
--- a/views_autorefresh/views_autorefresh.views.inc
+++ b/views_autorefresh/views_autorefresh.views.inc
@@ -4,6 +4,15 @@
  * Implementation of hook_views_data_alter().
  */
 function views_autorefresh_views_data_alter(&$data) {
+  // Add our autorefresh area to Global.
+  $data['views']['autorefresh'] = array(
+    'title' => t('Autorefresh config'),
+    'help' => t('Enable autorefresh for this view.'),
+    'area' => array(
+      'handler' => 'views_autorefresh_handler_area_autorefresh',
+    ),
+  );
+
   foreach ($data as $table_name => $table_info) {
     foreach ($table_info as $field_name => $field_info) {
       // Add an operator-based date handler to all date arguments.
@@ -33,22 +42,3 @@ function views_autorefresh_views_data_alter(&$data) {
   }
 }
 
-/**
- * Implementation of hook_views_handlers().
- */
-function views_autorefresh_views_handlers() {
-  return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views_autorefresh'),
-    ),
-    'handlers' => array(
-      'views_autorefresh_handler_argument_date' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_autorefresh_handler_argument_base' => array(
-        'parent' => 'views_handler_argument',
-      ),
-    ),
-  );
-}
-
diff --git a/views_autorefresh/views_autorefresh_handler_area_autorefresh.inc b/views_autorefresh/views_autorefresh_handler_area_autorefresh.inc
new file mode 100644
index 0000000..acc6d56
--- /dev/null
+++ b/views_autorefresh/views_autorefresh_handler_area_autorefresh.inc
@@ -0,0 +1,120 @@
+<?php
+
+/**
+ * Base class for area handlers.
+ *
+ * @ingroup views_area_handlers
+ */
+class views_autorefresh_handler_area_autorefresh extends views_handler_area {
+
+  /**
+   * Overrides views_handler_area::init().
+   *
+   * Reset override done in views_handler_area::init(). This area must be
+   * rendered even if view has no results.
+   */
+  function init(&$view, &$options) {
+    parent::init($view, $options);
+  }
+
+  function option_definition() {
+    $options = array();
+    $options['interval'] = array('default' => '');
+    $options['incremental'] = array('default' => FALSE, 'bool' => TRUE);
+    $options['display'] = array('default' => '');
+    $options['ping'] = array('default' => FALSE, 'bool' => TRUE);
+    $options['ping_base_path'] = array('default' => '');
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['interval'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Interval to check for new items'),
+      '#default_value' => $this->options['interval'],
+      '#description' => t('This data is interpreted as milliseconds.'),
+      '#required' => TRUE,
+    );
+    $form['incremental'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use a secondary view display to incrementally insert new items only'),
+      '#default_value' => $this->options['incremental'],
+    );
+    $options = array();
+    foreach ($this->view->display as $display) {
+      if (($display->display_plugin == 'page') && ($display->id != $form_state['display_id'])) {
+        # TODO: check secondary display arguments.
+        $options[$display->id] = $display->display_title;
+      }
+    }
+    $form['display'] = array(
+      '#type' => 'select',
+      '#title' => 'Choose the display',
+      '#default_value' => $this->options['display'],
+      '#description' => t('Only displays of type page are eligible. Additionally the display must have a timestamp argument of the <em>(with operator)</em> variant. For example <em>Node: Post date (with operator)</em>.'),
+      '#options' => $options,
+      '#dependency' => array(
+        'edit-options-incremental' => array(1),
+      ),
+    );
+    $form['ping'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use a ping url'),
+      '#default_value' => $this->options['ping'],
+      '#description' => t('Use a custom script for faster check of new items. See <code>ping.php.example</code> in <code>views_autorefresh</code> folder for reference.'),
+    );
+    global $base_url;
+    # TODO: offer to choose path to a module to better work out of the box with drupal_get_path() ?
+    $form['ping_base_path'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Path to the ping script'),
+      '#default_value' => $this->options['ping_base_path'],
+      '#description' => t('This url is relative to the Drupal root.'),
+      '#dependency' => array(
+        'edit-options-ping' => array(1),
+      ),
+    );
+  }
+
+  function options_validate(&$form, &$form_state) {
+    if (!is_numeric($form_state['values']['options']['interval'])) {
+      form_set_error('interval', t('Invalid interval.'));
+    }
+    # TODO: check the ping script actualy returns the json we are expecting?
+    if ($form_state['values']['options']['ping']) {
+      $ping_base_path = $form_state['values']['options']['ping_base_path'];
+      if (!file_exists(DRUPAL_ROOT . '/' . $ping_base_path)) {
+        form_set_error('ping_base_path', t('Ping script not found.'));
+      }
+    }
+  }
+
+  function render($empty = FALSE) {
+    $args = array();
+    $args['view'] = $this->view;
+    $args['interval'] = $this->options['interval'];
+    if  ($this->options['ping']) {
+      $args['ping'] = array(
+        'ping_base_path' => $this->options['ping_base_path'],
+      );
+    }
+    if  ($this->options['incremental']) {
+      $display = $this->view->display[$this->options['display']];
+
+      $args['incremental'] = array(
+        'view_base_path' => $display->display_options['path'],
+        'view_display_id' => $display->id,
+        'view_name' => $this->view->name,
+        'sourceSelector' => '.view-content',
+        'targetSelector' => '.view-content',
+        'firstClass' => 'views-row-first',
+        'lastClass' => 'views-row-last',
+        'oddClass' => 'views-row-odd',
+        'evenClass' => 'views-row-even',
+      );
+    }
+
+    return theme('views_autorefresh', $args);
+  }
+}
+
