diff --git a/shoutbox.rules.inc b/shoutbox.rules.inc
new file mode 100644
index 0000000..e289fe2
--- /dev/null
+++ b/shoutbox.rules.inc
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file Includes any rules integration provided by shoutbox.
+ */
+
+/**
+ * Implements hook_rules_event_info().
+ */
+function shoutbox_rules_event_info() {
+
+  $items = array(
+    'shoutbox_rules_add' => array(
+      'label' => t('After adding a shout'),
+      'group' => t('Shoutbox'),
+      'variables' => array(
+        'user' => array(
+          'type' => 'user',
+          'label' => t('Shoutbox message actor'),
+        ),
+        'shout_message' => array(
+          'type' => 'shoutbox_message',
+          'label' => t('Shoutbox message'),
+        ),
+      ),
+    ),
+  );
+
+  return $items;
+
+}
+
+/**
+ * Implements hook_rules_data_info().
+ */
+function shoutbox_rules_data_info() {
+  return array(
+    'shoutbox_message' => array(
+      'label' => t('Shoutbox'),
+      'group' => t('Shoutbox'),
+    ),
+  );
+}
\ No newline at end of file
diff --git a/shoutbox.tokens.inc b/shoutbox.tokens.inc
new file mode 100644
index 0000000..86a171d
--- /dev/null
+++ b/shoutbox.tokens.inc
@@ -0,0 +1,77 @@
+<?php
+/*
+ * @file
+ * Provides tokens by the shoutbox_message data type.
+ */
+
+/**
+ * Implements hook_token_info().
+ */
+function shoutbox_token_info() {
+  $type = array(
+    'name' => t('Shoutbox message'),
+    'description' => t('Tokens related to individual shoutbox messages.'),
+    'needs-data' => 'shoutbox_message',
+  );
+
+  $shoutbox_message['shoutbox-message-id'] = array(
+    'name' => t('Shoutbox message ID'),
+    'description' => t('Shoutbox message ID'),
+  );
+  $shoutbox_message['shoutbox-message-body'] = array(
+    'name' => t('Body of the Shoutbox message'),
+    'description' => t('Body of the Shoutbox message'),
+  );
+  $shoutbox_message['shoutbox-message-body-raw'] = array(
+    'name' => t('Body of the Shoutbox message. WARNING - raw user input'),
+    'description' => t('Body of the Shoutbox message. WARNING - raw user input'),
+  );
+
+  return array(
+    'types' => array('shoutbox_message' => $type),
+    'tokens' => array('shoutbox_message' => $shoutbox_message),
+  );
+}
+
+/**
+ * Implements hook_tokens().
+ */
+function shoutbox_tokens($type, $tokens, array $data = array(), array $options = array()) {
+
+  $url_options = array('absolute' => TRUE);
+  if (isset($options['language'])) {
+    $url_options['language'] = $options['language'];
+    $language_code = $options['language']->language;
+  }
+  else {
+    $language_code = NULL;
+  }
+  $sanitize = !empty($options['sanitize']);
+
+  $replacements = array();
+
+  if ($type == 'shoutbox_message' && !empty($data['shoutbox_message'])) {
+    $shoutbox_message = $data['shoutbox_message'];
+
+    foreach ($tokens as $name => $original) {
+      switch ($name) {
+
+        case 'shoutbox-message-id':
+          $replacements[$original] = $shoutbox_message->shout_id;
+          break;
+        case 'shoutbox-message-body':
+          $replacements[$original] = check_markup($shoutbox_message->shout);
+          break;
+        case 'shoutbox-message-body-raw':
+          $replacements[$original] = $shoutbox_message->shout;
+          break;
+
+      }
+    }
+
+  }
+
+  return $replacements;
+
+}
+
