Error in Phirehose.php

php
api

#1

hi all
when I run http://localhost/a/get_tweets.php in website it displayed:.
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\a\libraries\phirehose\Phirehose.php on line 407
please tell me where i am doing mistake


#2

It is hard to say what the problem might be without knowing more about your code and what you are trying to do. Can you share a sample that demonstrates this issue?


#3

Hi
thanks for your response.
I am using the below code

<?php

require_once('140dev_config.php');

require_once('libraries/phirehose/Phirehose.php');
require_once('libraries/phirehose/OauthPhirehose.php');
class Consumer extends OauthPhirehose
{
	
  
  public $oDB;
  public function db_connect() {
    require_once('db_lib.php');
    $this->oDB = new db;
  }
	

  public function enqueueStatus($status) {
	
	  $tweet_object = json_decode($status);
	
   if (!(isset($tweet_object->id_str))) { return;}
		
$tweet_id = $tweet_object->id_str;

 
$raw_tweet = base64_encode(serialize($tweet_object));
		
 $field_values = 'raw_tweet = "' . $raw_tweet . '", ' .
'tweet_id = ' . $tweet_id;
$this->oDB->insert('json_cache',$field_values);
  }
}

$stream = new Consumer(ACCESS_TOKEN, ACCESS_SECRET, Phirehose::METHOD_FILTER);

$stream->db_connect();


$stream->setTrack(array(recipe'));

$stream->consume();

?>

its a sample code in below link
http://140dev.com/free-twitter-api-source-code-library/twitter-database-server/get-tweets-php/


#4

Hi there. Just to clarify, you say you’re trying to run it from a website? You shouldn’t do that, it wasn’t intended to be run like that. You should run it from the command line.

Have you updated to the latest phirehose? It’s available at https://github.com/fennb/phirehose