diff --git a/sites/all/modules/twitter/twitter_post/twitter_post.install b/sites/all/modules/twitter/twitter_post/twitter_post.install
index af71041..71ffc38 100644
--- a/sites/all/modules/twitter/twitter_post/twitter_post.install
+++ b/sites/all/modules/twitter/twitter_post/twitter_post.install
@@ -10,6 +10,7 @@
  */
 function twitter_post_uninstall() {
   variable_del('twitter_post_types');
+  variable_del('twitter_post_vocabs');
   variable_del('twitter_post_default_format');
   variable_del('twitter_post_default_value');
 }
@@ -38,3 +39,4 @@ function twitter_post_update_7301() {
     ->execute();
   return t('Updated system weight to 10 for Twitter Post.');
 }
+
diff --git a/sites/all/modules/twitter/twitter_post/twitter_post.module b/sites/all/modules/twitter/twitter_post/twitter_post.module
index 0effd13..af76b38 100644
--- a/sites/all/modules/twitter/twitter_post/twitter_post.module
+++ b/sites/all/modules/twitter/twitter_post/twitter_post.module
@@ -82,6 +82,7 @@ function twitter_post_node_insert($node) {
 
     $twitter_account = twitter_account_load($node->twitter['account']);
     $replacements = array(
+      '!hashtags' => '',
       '!title' => $node->title,
       '!url' => url('node/' . $node->nid, array('absolute' => TRUE, 'alias' => TRUE)),
       '!url-alias' => url('node/' . $node->nid, array('absolute' => TRUE)),
@@ -94,7 +95,52 @@ function twitter_post_node_insert($node) {
       $replacements['!tinyurl'] = twitter_shorten_url(url('node/' . $node->nid, array('absolute' => TRUE)));
     }
 
-    $status = strtr($node->twitter['status'], $replacements);
+// add support for hashtags
+    $vid = variable_get('twitter_post_vocabs', 0);
+
+    if ($vid != 0) { // yes, user has selected a vocab for hashtags
+
+// from http://rocktreesky.com/drupal-twitter-hashtag-hack and
+// https://drupal.org/node/1517744 and
+// http://drupal.stackexchange.com/questions/8722/how-do-i-get-a-list-of-all-taxonomy-terms-assigned-to-a-node
+
+      $term_query = db_select('taxonomy_index', 'ti');
+      $ttd_alias = $term_query->join('taxonomy_term_data', 'ttd',
+        'ti.tid = %alias.tid');
+      $term_query->addField($ttd_alias, 'name');
+      $term_query->condition('ti.nid', $node->nid)
+        ->condition($ttd_alias . '.vid', $vid)
+        ->orderBy($ttd_alias . '.weight', 'ASC')
+        ->orderBy($ttd_alias . '.tid', 'ASC');
+      $terms = $term_query->execute()
+        ->fetchAll();
+
+      if ($terms) { // if any terms
+
+        foreach ($terms as $term) { // loop through terms
+
+// if the term is already there as a hashtag, do nothing
+          if (preg_match('/#\b' . $term->name . '\b/',
+            $replacements['!title'])) continue;
+
+// if we can replace a term in the title with its hashtag equivalent, do so
+          $count = 0;
+          $replacements['!title'] = preg_replace('/\b' . $term->name . '\b/',
+            '#' . $term->name, $replacements['!title'], 1, $count);
+
+// no replacements?  add hashtag to tag string
+          if (!$count) $replacements['!hashtags'] .= ' #' . $term->name;
+
+        } // foreach term
+
+      } // any terms?
+
+    } // user wants hashtags?
+
+// trim and squeeze extra spaces
+    $status = trim(preg_replace('/\s+/', ' ',
+      strtr($node->twitter['status'], $replacements)));
+
     if (twitter_set_status($twitter_account, $status)) {
       drupal_set_message(t('Successfully posted to Twitter'));
     }
diff --git a/sites/all/modules/twitter/twitter_post/twitter_post.pages.inc b/sites/all/modules/twitter/twitter_post/twitter_post.pages.inc
index a0bf4cb..ad608c2 100644
--- a/sites/all/modules/twitter/twitter_post/twitter_post.pages.inc
+++ b/sites/all/modules/twitter/twitter_post/twitter_post.pages.inc
@@ -17,13 +17,30 @@ function twitter_post_admin_settings($form, &$form_state) {
     '#default_value' => variable_get('twitter_post_types', NULL),
   );
 
+// borrowed from
+// https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_vocabularies/7
+
+  $vocabulary = taxonomy_get_vocabularies();
+  $vocab_array = array('0' => '(do not add hashtags)');
+
+  foreach ($vocabulary as $item)
+    $vocab_array[$item->vid] = check_plain($item->name);
+
+  $form['twitter_post_vocabs'] = array(
+    '#title' => t('Vocabulary name'),
+    '#type' => 'select',
+    '#description' => t('Choose which vocabulary\'s tagged terms should be included as hashtags when posting to Twitter.'),
+    '#options' => $vocab_array,
+    '#default_value' => variable_get('twitter_post_vocabs', 0),
+  );
+
   $form['twitter_post_default_format'] = array(
     '#type' => 'textfield',
     '#title' => t('Default format string'),
     '#maxlength' => 140,
     '#description' => t('The given text will be used as a template for posting to Twitter.com. ' .
-                        'The following token replacements are available: !url, !url-alias, !tinyurl, !title, and !user'),
-    '#default_value' => variable_get('twitter_post_default_format', 'New post: !title !tinyurl'),
+                        'The following token replacements are available: !url, !url-alias, !tinyurl, !title, !user, and !hashtags.'),
+    '#default_value' => variable_get('twitter_post_default_format', 'New post: !title !hashtags !tinyurl'),
   );
 
   $form['twitter_post_default_value'] = array(
@@ -35,3 +52,4 @@ function twitter_post_admin_settings($form, &$form_state) {
 
   return system_settings_form($form);
 }
+
