A little description about default tweet reader page for make your own customizations.
Step 1) Initialize Script

include('TweetReader.class.php'); * this is a standard php include if you keep the default file tree this will be the line you'll use.
$twitter = new TweetReader(); * this is the initialization of the class.
$twitter->user = 'YOUR_TWITTER_USERNAME'; * set twitter username to grab data.
$twitter->postLimit = 10; Optional: Set the post limit ~ maximum value =20 .
$twitter->cache= 'cache/'; set folder path to save local cache of Twitter update
$twitter->cachExpire = 300; Optional: set seconds that cache is classed as "old"
$twitter->debug = false; Optional: turn on or off degug mode (true/false)
$twitter->targetNew = true; Optional: open links in new tab (true/false)
$twitter->init(); * call to generate the stuff
$my_twitter=$twitter->data; * retrieve data to local varibale '$my_twitter'
Default tweet reader page:
<?php
include('TweetReader.class.php');
$twitter = new TweetReader(); // Call TweetReader class
$twitter->user = 'google'; // Set the user to get info from
$twitter->postLimit = 10; // Optional: Set the post limit ~ maximum of 20 posts
$twitter->init(); // Generate the stuff
$my_twitter=$twitter->data; //retrieve data
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $my_twitter['name'] ?>'s Tweets</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="head">
<table width="100%" cellspacing="5px;">
<tr>
<td class="icon"><img src="<?php echo $my_twitter['img'] ?>" alt="pic" /></td>
<td>
<div class="user">
<a href="<?php echo $my_twitter['user_profile'] ?>"><img src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png" alt="Follow yaaya_mobi on Twitter"/></a> <?php echo $my_twitter['name'] ?>'s Tweets
</div>
<span class="followers"><?php echo $my_twitter['followers'] ?>, <?php echo $my_twitter['statuses_count'] ?> Tweets</span><br />
› <a href="<?php echo $my_twitter['user_profile'] ?>">Follow @<?php echo $my_twitter['screen_name'] ?></a>
</td>
</tr>
</table>
</div>
<?php if($my_twitter['is_available']) { ?>
<ul class="tweets">
<?php foreach($my_twitter['tweets'] as $tweet){ ?>
<li><i>"</i> <?php echo $tweet['text'] ?> <i>"</i><br /><img src="images/min_twt.gif" alt="" width="13" height="13" /> <span class="time"><?php echo $tweet['time'] ?></span></li>
<?php } ?>
</ul>
<?php } else { ?>
<div class="error">@<?php echo $my_twitter['user'] ?> hasn't tweeted yet.</div>
<?php } ?>
<div class="footer">‹ <a href="/">HOME</a></div>
<!-- you can remove this line --><div class="dev">Mobi Scripts by <a href="http://yaaya.mobi/?scripts">Yaaya</a></div>
</body>
</html> |
|