-
-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathload.php
More file actions
29 lines (21 loc) · 913 Bytes
/
load.php
File metadata and controls
29 lines (21 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
use DG\Twitter\Twitter;
require_once '../src/twitter.class.php';
// enables caching (path must exists and must be writable!)
// Twitter::$cacheDir = __DIR__ . '/temp';
// ENTER HERE YOUR CREDENTIALS (see readme.txt)
$twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
$statuses = $twitter->load(Twitter::ME_AND_FRIENDS);
?>
<!doctype html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Twitter timeline demo</title>
<ul>
<?php foreach ($statuses as $status) { ?>
<li><a href="https://twitter.com/<?php echo $status->user->screen_name ?>"><img src="<?php echo htmlspecialchars($status->user->profile_image_url_https) ?>">
<?php echo htmlspecialchars($status->user->name) ?></a>:
<?php echo Twitter::clickable($status) ?>
<small>at <?php echo date('j.n.Y H:i', strtotime($status->created_at)) ?></small>
</li>
<?php } ?>
</ul>