-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathfriends.php
More file actions
executable file
·34 lines (26 loc) · 1.04 KB
/
friends.php
File metadata and controls
executable file
·34 lines (26 loc) · 1.04 KB
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
<?php
include('auth/secret.php');
include('auth/php/EpiCurl.php');
include('auth/php/EpiOAuth.php');
include('auth/php/EpiTwitter.php');
$twitterObj = new EpiTwitter(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
$twitterInfo = null;
$timeline = null;
$callback = $_GET['callback'];
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$type = isset($_GET['type']) ? $_GET['type'] : 'statusesFriends_timeline';
$data = '[]';
if ($_COOKIE['token'] && file_exists('auth/oauth/' . $_COOKIE['token'])) {
$username = file_get_contents('auth/oauth/' . $_COOKIE['token']);
$userToken = $_COOKIE['token'];
$userSecret = file_get_contents('auth/oauth/' . $username . '-sec');
$twitterObj->setToken($userToken, $userSecret);
$twitterInfo = $twitterObj->get_accountVerify_credentials();
// why I have to probe twitterInfo I'll never know
if ($twitterInfo->screen_name) {}
$method = "get_" . $type;
$timeline = $twitterObj->$method(array('count' => 200, 'page' => $page));
$data = json_encode($timeline->response);
}
echo $callback . '(' . $data . ')';
?>