Twitter API Consulting
140dev@gmail.com
781-879-2960
@140dev

Free open source code for Twitter API Engagement Programming

/report/display_tweets.php

<?php
// Copyright (c) 2013 Adam Green. All rights reserved.
// See http://140dev.com/download/license.txt for licensing of this code.

if(sizeof($tweets)) {
	require_once('../display_lib.php');
	
	$tweet_html = '<link rel="stylesheet" type="text/css" media="all" href="tweet.css" />';
	$template_html = file_get_contents('tweet_template.html');
	foreach($tweets as $tweet) {
		$tweet_html .= $template_html;
		$tweet_html = str_replace('[user_id]',$tweet['user_id'],$tweet_html);	
		$tweet_html = str_replace('[screen_name]',$tweet['screen_name'],$tweet_html);
		$tweet_html = str_replace('[name]',$tweet['name'],$tweet_html);
		$tweet_html = str_replace('[tweet_id]',$tweet['tweet_id'],$tweet_html);
		$tweet_html = str_replace('[tweet_text]',linkify($tweet['tweet_text']),$tweet_html);
		$tweet_html = str_replace('[profile_image_url]',$tweet['profile_image_url'],$tweet_html);
		$tweet_html = str_replace('[created_at]',twitter_time($tweet['created_at']),$tweet_html);
		$tweet_html = str_replace('[retweet_count]',$tweet['retweet_count'],$tweet_html);
	}
	
	print $tweet_html;
} else {
	print "No tweets found";
}

?>


Thanks, @140dev for the sweet open source API code.