Hi,

I just assigned @ApacheHama the task of retweeting a tweets around a
#ApacheHama hashtag.

Currently, it is run on my personal test server, as a cronjob. MySQL
is used to check whether already retweeted as below.

Does anyone have ideas to move this job to (people.apache.org server)?

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $key, $secret);
$response = $connection->get('search', array('q'=>'#ApacheHama OR
"apache hama"'));
foreach ($response as $status) {

  for($i=0; $i < count($status); $i++)
  {
    $tweetid = $status[$i];
    $result = mysql_fetch_array(mysql_query("select tid from tweets
where tid = ".$tweetid.";"));
    if(empty($result['tid'])) {
      mysql_query("insert into tweets (tid) values (".$tweetid.");");
      $connection->post('statuses/retweet/'.$tweetid);
    }
  }

}

-- 
Best Regards, Edward J. Yoon
[email protected]
http://blog.udanax.org

Reply via email to