-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·75 lines (73 loc) · 2.31 KB
/
index.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!doctype HTML>
<html lang="en">
<head>
</head>
<body>
<style>
body{
font-family:tahoma;
margin:0;
padding:0;
}
a{
text-decoration:none;
color:#0099B9;
cursor:pointer;
}
ul{
margin:0;
padding:0;
}
ul li{
list-style:none;
background:#eee;
padding:10px;
margin-bottom:20px;
width:400px;
font-size:10pt;
}
</style>
<?php include_once('feeds-api/twitter.php'); ?>
<ul>
<?php
foreach ($twitter_data as $tweet) {
//$retweet = $tweet['retweeted_status'];
$isRetweet = !empty($retweet);
# Retweet - get the retweeter's name and screen name
$retweetingUser = $isRetweet ? $tweet['user']['name'] : null;
$retweetingUserScreenName = $isRetweet ? $tweet['user']['screen_name'] : null;
# Tweet source user (could be a retweeted user and not the owner of the timeline)
$user = !$isRetweet ? $tweet['user'] : $retweet['user'];
$userName = $user['name'];
$userScreenName = $user['screen_name'];
$userAvatarURL = stripcslashes($user['profile_image_url']);
$userAccountURL = 'http://twitter.com/' . $userScreenName;
# The tweet
$id = $tweet['id'];
$formattedTweet = !$isRetweet ? formatTweet($tweet['text']) : formatTweet($retweet['text']);
$statusURL = 'http://twitter.com/' . $userScreenName . '/status/' . $id;
$date = timeAgo($tweet['created_at']);
# Reply
$replyID = $tweet['in_reply_to_status_id'];
$isReply = !empty($replyID);
# Tweet actions (uses web intents)
$replyURL = 'https://twitter.com/intent/tweet?in_reply_to=' . $id;
$retweetURL = 'https://twitter.com/intent/retweet?tweet_id=' . $id;
$favoriteURL = 'https://twitter.com/intent/favorite?tweet_id=' . $id;
?>
<!--HERE'S THE RESULT-->
<li >
<a href="<?php echo $userAccountURL; ?>"><img src="<?php echo $userAvatarURL; ?>"></a></br>
UserName : <a href="<?php echo $userAccountURL; ?>"><?php echo $userName; ?></a> ,
<a href="<?php echo $userAccountURL; ?>">@<?php echo $userScreenName; ?></a></br>
Date Posted : <a href="<?php echo $statusURL; ?>" target="_blank"><?php echo $date; ?></a></br>
Text :<?php echo $formattedTweet ; ?></br>
<a href=" <?php echo $statusURL; ?>" target="_blank">Details</a></p>
</li>
<!-- END RESULT -->
<?php
}
?>
</ul>
</body>
</html>