public function TwitterBlockSearch::__construct in Twitter Block 7        
                          
                  
                        Same name and namespace in other branches
- 6 twitter_block.class.php \TwitterBlockSearch::__construct()
File
 
   - ./twitter_block.class.php, line 42
- Lightweight implementation of the Twitter API in PHP.
Class
  
  - TwitterBlockSearch 
- TwitterBlockSearch provides the class for using the Twitter Search API.
Code
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') {
    
    $this->search_string = $config['search_string'];
  }
  else {
    $this->twitter_name = $config['search_string'];
  }
  $this->include_rts = $config['include_rts'];
  $count = $this->api == 'rest' ? 'count' : 'rpp';
  
  $this->options[$count] = $config['results_per_page'];
  
  if (isset($config['lang']) && !empty($config['lang'])) {
    $this->options['lang'] = $config['lang'];
  }
}