Count Retweet using tmhOAuth


Hi all,

I need some help in using the Twitter API. first of all, i’m a beginner in Twitter API + PHP thing. Im using tmhOAuth as my learning ground.
My app is some sort of reporting tools, where i can search particular keyword and see how many RTs that a particular tweet got.

this is my coding


require 'class/tmhOAuth.php';
require 'class/tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array());
$newClass = new tmhOAuth(array());

$args = array('q' => $_GET[q],'since_id' => '0','rpp'      => '100');
	$i = 0;
	$results = array();

	for ($i=$pages; $i > 0; $i--) {
		$args['page'] = $i;

		if ($tmhOAuth->response['code'] == 200) {
			$data = json_decode($tmhOAuth->response['response'], true);
			$results = array_merge($results, $data['results']);
		else {
			echo 'Error';
	echo '<p style="color:brown">';
	echo 'Search Term: '. stripslashes($_GET['q']);
	echo '</p>';
	foreach( $results as $result ){
		echo '<p><div id="tweets">';
		echo '<p>'.$i.'</p> ';
		echo '<div class="avatar"><img src="'. "{$result['profile_image_url']}". '" /> </div>';
		echo '<div class="twitcont">';
		echo '<div class="name">'. "@<a href='{$result['from_user']}' target='_blank'>{$result['from_user']}</a>";
		echo "({$result['from_user_name']})";
		echo '</div>';
		echo '<div class="content">' . "{$result['text']}";
		echo '</div></div></div></p>';

		if ($newClass->response['code'] == 200) {
			$data = json_decode($newClass->response['response'], true);
			$results = array_merge($results, $data['results']);
		else {
			echo 'Error';

I try google it for some retweet counts example but to no success.


line 46: request(‘GET’,“{$result[‘id_str’]}.json”);

try that and let me know if you get something