? LICENSE.txt
Index: twitter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/twitter/twitter.module,v
retrieving revision 1.9
diff -u -p -r1.9 twitter.module
--- twitter.module	7 Sep 2008 23:59:31 -0000	1.9
+++ twitter.module	8 Mar 2009 05:44:58 -0000
@@ -83,7 +83,7 @@ function twitter_nodeapi(&$node, $op, $a
       if (!empty($node->status) && !empty($node->twitter) && !empty($node->twitter['post'])) {
         $twitter_accounts = twitter_get_user_accounts($node->uid, TRUE);
         $replacements = array('!title' => $node->title,
-                              '!url' => url('node/'. $node->nid, array('absolute' => TRUE)),
+                              '!url' => twitterurl('node/'. $node->nid),
                               '!user' => $node->name);
         $status = strtr($node->twitter['status'], $replacements);
         $pass = $twitter_accounts[$node->twitter['account']]['password'];
Index: twitter.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/twitter/twitter.pages.inc,v
retrieving revision 1.3
diff -u -p -r1.3 twitter.pages.inc
--- twitter.pages.inc	22 Aug 2008 03:57:11 -0000	1.3
+++ twitter.pages.inc	8 Mar 2009 05:44:58 -0000
@@ -48,7 +48,14 @@ function twitter_admin_form() {
     '#description' => t('The given text will be posted to twitter.com. You can use !url, !title and !user as replacement text.'),
     '#default_value' => variable_get('twitter_default_format', 'New post: !title (!url)'),
   );
-
+  
+  // Added by Duane Jeffers for tinyurl support.
+  $form['posting']['twitter_tinyurl'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('TinyURL Support'),
+    '#default_value' => variable_get('twitter_tinyurl', FALSE)
+  );
+  
   return system_settings_form($form);
 }
 
Index: twitter_actions/twitter_actions.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/twitter/twitter_actions/twitter_actions.module,v
retrieving revision 1.1
diff -u -p -r1.1 twitter_actions.module
--- twitter_actions/twitter_actions.module	25 Sep 2008 15:45:52 -0000	1.1
+++ twitter_actions/twitter_actions.module	8 Mar 2009 05:44:58 -0000
@@ -7,6 +7,20 @@
  */
 
 /**
+ * This is an internal function for formatting and automagically generating TinyURLs
+ **/
+function twitterurl($path) {
+  $turl_var = variable_get('twitter_tinyurl', FALSE);
+  $turl = url(drupal_get_path_alias($path), array('absolute' => TRUE));
+  if($turl_var == TRUE) {
+    $ch = curl_init("http://tinyurl.com/api-create.php?url=".$turl);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
+    curl_setopt($ch, CURLOPT_HEADER, FALSE);
+    $turl = trim(curl_exec($ch)); // Trimming any whitespace for a better result.
+  }
+  return $turl;
+}
+/**
  * Implementation of hook_action_info().
  */
 function twitter_actions_action_info() {
@@ -161,7 +175,7 @@ function twitter_actions_set_status_acti
   if (isset($node) && is_object($node)) {
     $variables = array_merge($variables, array(
         '%uid' => $node->uid,
-        '%node_url' => url('node/'. $node->nid, array('absolute' => TRUE)),
+        '%node_url' => twitterurl('node/'. $node->nid),
         '%node_type' => node_get_types('name', $node),
         '%title' => $node->title,
         '%teaser' => $node->teaser,
