diff --git a/twitter.class.php b/twitter.class.php
index e757591..b3f871d 100644
--- a/twitter.class.php
+++ b/twitter.class.php
@@ -31,13 +31,18 @@ class TwitterSearch {
   private $search_string;
   private $twitter_name;
 
+  // API
+  private $api;
+
   // The url including the encoded query
   public $url_query;
 
   public function __construct($config = array()) {
+    $this->url_query = 'http://search.twitter.com/search.json?';
     $this->search_type = $config['search_type'];
+    $this->api = in_array($this->search_type, array('getTweetsFrom')) ? 'rest' : 'search';
     
-    if ( $config['search_type'] == 'searchHashtag' ) {
+    if ($config['search_type'] == 'searchHashtag') {
       // We presume the search string is already validated. 
       $this->search_string = $config['search_string'];
     }
@@ -45,12 +50,13 @@ class TwitterSearch {
       $this->twitter_name = $config['search_string'];
     }
 
+    $count = ($this->api == 'rest') ? 'count' : 'rpp';
     // The number of tweets to return per page.
-    if ( !empty( $config['results_per_page']) ) {
-      $this->options['rpp'] = $config['results_per_page'];
+    if (!empty($config['results_per_page'])) {
+      $this->options[$count] = $config['results_per_page'];
     }
     else {
-      $this->options['rpp'] = variable_get('twitter_block_default_results_per_page', 15);
+      $this->options[$count] = variable_get('twitter_block_default_results_per_page', 15);
     }
 
     // Filter by language, but only if there is one set in the config.
@@ -63,7 +69,15 @@ class TwitterSearch {
    * Retrieve JSON encoded search results
    */
   public function getJSON() {
-    return call_user_func(array($this, $this->search_type)); 
+    $ret = call_user_func(array($this, $this->search_type)); 
+    if (empty($ret)) {
+      return NULL;
+    }
+    $ret = json_decode($ret);
+    if ($this->api == 'rest') {
+      return $ret;
+    }
+    return $ret->results;
   }
 
   /**
@@ -72,7 +86,8 @@ class TwitterSearch {
    * @return string $json JSON encoded search response
    */
   private function getTweetsFrom() {
-    $this->options['q'] = "from:$this->twitter_name";
+    $this->options['screen_name'] = $this->twitter_name;
+    $this->url_query = 'http://api.twitter.com/1/statuses/user_timeline.json?';
     $json = $this->search();
     return $json;
   }
@@ -123,7 +138,7 @@ class TwitterSearch {
    * @return string JSON encoded search response.
    */
   function search() {
-    $this->url_query = 'http://search.twitter.com/search.json?' . drupal_http_build_query($this->options);
+    $this->url_query .= drupal_http_build_query($this->options);
     $ch = curl_init($this->url_query);
     
     // Applications must have a meaningful and unique User Agent. 
diff --git a/twitter_block.module b/twitter_block.module
index 679b5dc..6d81f8d 100644
--- a/twitter_block.module
+++ b/twitter_block.module
@@ -211,30 +211,29 @@ function twitter_block_block_save($delta = '', $edit = array()) {
 function twitter_block_block_view($delta) {
   module_load_include( 'php', 'twitter_block', 'twitter.class' );
 
-
   $block = array();
   $config = get_twitter_block_config($delta);
 
   $twitter = new TwitterSearch($config);
   $twitter_reply = cache_get($cid = 'twitter_block_' . $delta, $bin = 'cache');
 
-    $block['subject'] = t($config['default_title']);
+  $block['subject'] = t($config['default_title']);
 
   if ($twitter_reply == NULL) {
-      $twitter_reply = json_decode($twitter->getJSON());
-      if (!isset( $twitter_reply -> results) ) {
-    watchdog('Twitter Block', 'Recieved an unexpected reply from Twitter. ' .
+    $twitter_reply = $twitter->getJSON();
+    if (!isset( $twitter_reply)) {
+      watchdog('Twitter Block', 'Recieved an unexpected reply from Twitter. ' .
         'Perhaps just a fail whale? Our search url with query:<br/>' .
         '@url_query', array( 'url_query' => $twitter -> url_query),
         WATCHDOG_NOTICE);
-  }
-      else{
+    }
+    else{
       cache_set('twitter_block_' . $delta, $twitter_reply, 'cache', CACHE_TEMPORARY);
-      $block['content'] = theme('twitter_block', $twitter_reply -> results );
-      }
+      $block['content'] = theme('twitter_block', $twitter_reply);
+    }
   }
   else{
-      $block['content'] = theme('twitter_block', $twitter_reply -> data ->results );
+    $block['content'] = theme('twitter_block', $twitter_reply->data);
   }
 
   return $block;
