Exemple #1
0
<?php

require 'functions.php';
?>
<!doctype html>
<html>
<head>
	<title>Twitter API Demo</title>
	<link rel="stylesheet" href="styles.css">
</head>
<body>

<?php 
$tweets = getTweetsFromJSON('slicknet');
foreach ($tweets as $tweet) {
    echo '<div class="tweets">' . $tweet->text . '</div>';
}
?>
	
</body>
</html>
Exemple #2
0
<?php

require 'functions.php';
$tweets = getTweetsFromJSON();
echo '<ul>';
foreach ($tweets as $tweet) {
    echo '<li>';
    echo '<img src="' . $tweet->user->profile_image_url . '" />';
    echo $tweet->text;
    echo '<div class="date">' . $tweet->created_at . '</div>';
    echo '<div style="clear:both;"></div>';
    echo '</li>';
}
echo '</ul>';
<?php

require 'functions.php';
$name = $_GET['name'];
$tweets = getTweetsFromJSON($name);
echo '<ul>';
foreach ($tweets as $tweet) {
    echo '<li>';
    echo '<img src="' . $tweet->user->profile_image_url . '" />';
    echo $tweet->text;
    echo '<div class="date">' . $tweet->created_at . '</div>';
    echo '<div style="clear:both;"></div>';
    echo '</li>';
}
echo '</ul>';