Skip to content

Commit

Permalink
added custom-request example
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 16, 2012
1 parent b930c60 commit cd0d34a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/custom-request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

require_once '../src/twitter.class.php';

// ENTER HERE YOUR CREDENTIALS (see readme.txt)
$twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);

// See https://dev.twitter.com/docs/api/1.1
$statuses = $twitter->request('statuses/retweets_of_me', 'GET');

?>
<!doctype html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Twitter retweets of me</title>

<ul>
<?php foreach ($statuses as $status): ?>
<li><a href="http://twitter.com/<?php echo $status->user->screen_name ?>"><img src="<?php echo htmlspecialchars($status->user->profile_image_url) ?>">
<?php echo htmlspecialchars($status->user->name) ?></a>:
<?php echo Twitter::clickable($status->text) ?>
<small>at <?php echo date("j.n.Y H:i", strtotime($status->created_at)) ?></small>
</li>
<?php endforeach ?>
</ul>

0 comments on commit cd0d34a

Please sign in to comment.