footer { background-color: #fefefe; margin-left: 20px; margin-right: 20px; } hr { margin-top: 10px; margin-bottom: 5px; } </style> <body> <div class="tweet-box"> <h4 class="navbar-text">TweetUdit</h4> <span id="liName" class="navbar-text">' . $user->get_name() . '</span> <span id="liScreenName" class="navbar-text"> <strong><em>(@' . $user->get_screen_name() . ')</em></strong></span> <img class="img-polaroid" src="' . $user->get_profile_image_url() . '"> </div> <div class="clearfix"> </div> <div class="clearfix"> </div> <div class="clearfix"> </div> <div class="container"> <div class="container-fluid row"> <div id="wall" class="container-fluid"> <h4 class="offset tweet-box">My Home Timeline</h4>'; foreach ($user->get_tweets_object() as $tweet) { $html = $html . ' <div class="container-fluid tweet-box item"> <div class="container-fluid row"> <div class="container-fluid span">
header('Location: ../DBError.html'); } if(empty($_REQUEST['screenName'])) $id = $_SESSION['user']; else { if(stripos($_REQUEST['screenName'],"@")===0) { $rs = mysqli_query($con,"select * from user where screen_name='".strtok($_REQUEST['screenName'],"@")."'"); } else { $rs = mysqli_query($con,"select * from user where name='".$_REQUEST['screenName']."'"); } if($rs = mysqli_fetch_array($rs)) { $id = $rs['id']; } else { header('Location: DBError.html'); } } $rs = mysqli_query($con,"select * from user where id='".$id."'"); if($rs = mysqli_fetch_array($rs)) { $user = new User($rs); } else { header('Location: ../DBError.html'); } mysqli_close($con); echo json_encode(array("profileImageURL"=>$user->get_profile_image_url()));
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) { header('Location: clearsession.php'); } /* Get user access tokens out of the session. */ $access_token = $_SESSION['access_token']; /* Create a TwitterOauth object with consumer/user tokens. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); /* If method is set change API call made. Test is called by default. */ $user = new User($connection->get('account/verify_credentials')); $con = mysqli_connect($host, $username, $password, $dbName); if (mysqli_connect_errno($con)) { header('Location: DBError.html'); } $rs = mysqli_query($con, "select id from user where id='" . $user->get_id() . "'"); if ($rs = mysqli_fetch_array($rs)) { mysqli_query($con, "update user\r\n set id = '" . $user->get_id() . "',\r\n screen_name = '" . $user->get_screen_name() . "',\r\n name = '" . $user->get_name() . "',\r\n profile_image_url = '" . $user->get_profile_image_url() . "',\r\n profile_background_image_url = '" . $user->get_profile_background_image_url() . "',\r\n profile_sidebar_fill_color = '" . $user->get_profile_sidebar_fill_color() . "',\r\n profile_background_color = '" . $user->get_profile_background_color() . "',\r\n profile_link_color = '" . $user->get_profile_link_color() . "'\r\n where id = '" . $user->get_id() . "'"); } else { mysqli_query($con, "insert into user values (\r\n '" . $user->get_id() . "',\r\n '" . $user->get_screen_name() . "',\r\n '" . $user->get_name() . "',\r\n '" . $user->get_profile_image_url() . "',\r\n '" . $user->get_profile_background_image_url() . "',\r\n '" . $user->get_profile_sidebar_fill_color() . "',\r\n '" . $user->get_profile_background_color() . "',\r\n '" . $user->get_profile_link_color() . "')"); } mysqli_close($con); $_SESSION['user'] = $user->get_id(); ?> <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
set id = '".$user->get_id()."', screen_name = '".$user->get_screen_name()."', name = '".$user->get_name()."', profile_image_url = '".$user->get_profile_image_url()."', profile_background_image_url = '".$user->get_profile_background_image_url()."', profile_sidebar_fill_color = '".$user->get_profile_sidebar_fill_color()."', profile_background_color = '".$user->get_profile_background_color()."', profile_link_color = '".$user->get_profile_link_color()."' where id = '".$user->get_id()."'"); } else { $user = new User($connection->get("users/show",array("screen_name"=>$screen_name,"includes_entities"=>false))); mysqli_query($con, "insert into user values ( '".$user->get_id()."', '".$user->get_screen_name()."', '".$user->get_name()."', '".$user->get_profile_image_url()."', '".$user->get_profile_background_image_url()."', '".$user->get_profile_sidebar_fill_color()."', '".$user->get_profile_background_color()."', '".$user->get_profile_link_color()."')"); } $tweets = $connection->get("statuses/user_timeline",array("screen_name"=>$screen_name,"count"=>10,"exclude_replies"=>true)); mysqli_query($con, "delete from tweet where user_id='' or user_id = '".$user->get_id()."'"); if(count($tweets)!=0 && is_array($tweets)) { foreach ($tweets as $tweet) { $user->set_tweets(new Tweet($tweet->id_str, $tweet->text, $tweet->user->screen_name, $tweet->user->profile_image_url, $tweet->created_at)); mysqli_query($con, "insert into tweet values ( '".$tweet->id_str."',