replace this part of the code …
<?php print_r($content); ?>
with a loop through the the $content Array with Objects
foreach ($content as $item) {
// … loop of content array … each result as $item
}
Tweet data as $item->[OBJECT_NAME]
User data as $item->user->[OBJECT_NAME]
… simple example:
<?php
foreach ($content as $item) { // ---- start foreach ----
echo “<div class=“userdata” style=“clear:both; padding:8px; margin:10px; border: 1px solid #AAAAAA; background:#FFFFAA; width:570px; text-align:left;”> \r\n”;
echo “<img src=”". $item->user->profile_image_url ."" style=“border:none; width:40px; float:left; padding:0px 8px 4px 0px;” /> \r\n";
echo “User: <a href=“http://twitter.com/#!/”. $item->user->screen_name .”" target="_blank">". $item->user->screen_name ." \r\n";
echo "
Name: “. $item->user->name .”\r\n";
echo “\r\n”;
echo "
Friends: “. $item->user->friends_count .”\r\n";
echo " Follower: “. $item->user->followers_count .” \r\n";
echo " Listed: “. $item->user->listed_count .” \r\n";
echo " Favourites: “. $item->user->favourites_count .” \r\n";
echo " Tweets: “. $item->user->statuses_count .” \r\n";
echo "
Location: “. $item->user->location .” \r\n";
echo "
Language: “. $item->user->lang .” \r\n";
echo "
User URL: “. $item->user->url .” \r\n";
echo "
Description: “. $item->user->description .” \r\n";
echo “\r\n”;
echo "
\r\n";
echo “<span class=“thetweet” style=“padding:6px; background:#DEDEDE; line-height:16px; display:block;”> \r\n”;
echo $item->text ."\r\n"; // — the status text = the tweet —
echo " \r\n";
echo “\r\n”;
echo "
direct link to <a href=“http://twitter.com/#!/”. $item->user->screen_name ."/statuses/". $item->id_str ."" traget="_blank">TWEET \r\n";
echo “\r\n”;
echo "
\r\n";
echo "
Date: “. $item->created_at .” \r\n";
echo "
Souce: “. $item->source .” \r\n";
echo "
\r\n";
echo " \r\n";
} // ---- end foreach ----
// --------- DEBUG data ---------
echo “\r\n”;
print_r($content);
echo “\r\n”;
?>
loop the content Array (foreach) and print out (echo) the objects values of each item
if you put a # on the begin of a line this line will not be executed (eg. User URL)
you can change style/html … and even better: set styles by classes in css-file
… also see example here: https://dev.twitter.com/discussions/1169